public static Job <string> ReserveString(this IBeanstalkClient client) { var job = client.Reserve(); using (var reader = new StreamReader(job.Data)) { return(new Job <string>(job.Id, reader.ReadToEnd())); } }
public static Job <string> ReserveString(this IBeanstalkClient client, TimeSpan timeout) { var job = client.Reserve(timeout); if (job == null) { return(null); } using (var reader = new StreamReader(job.Data)) { return(new Job <string>(job.Id, reader.ReadToEnd())); } }
public static PutResponse PutString(this IBeanstalkClient client, string data, uint priority, TimeSpan delay, TimeSpan timeToRun) { using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(data))) { return(client.Put(priority, delay, timeToRun, stream, stream.Length)); } }
public static PutResponse PutString(this IBeanstalkClient client, string data) { using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(data))) { return(client.Put(client.Defaults.Priority, client.Defaults.Delay, client.Defaults.TimeToRun, stream, stream.Length)); } }