public string AddJob(string queueName, string job, long mstimeout, JobParams jobParams) { //ADDJOB queue_name job <ms-timeout> [REPLICATE <count>] [DELAY <sec>] [RETRY <sec>] [TTL <sec>] [MAXLEN <count>] [ASYNC] string result; if (jobParams.Async) { result = (string)_c.Call( Commands.ADDJOB.ToString(), queueName, job, mstimeout.ToString(), Keywords.REPLICATE.ToString(), jobParams.Replicate.ToString(), Keywords.DELAY.ToString(), jobParams.Delay.ToString(), Keywords.RETRY.ToString(), jobParams.Retry.ToString(), Keywords.TTL.ToString(), jobParams.Ttl.ToString(), Keywords.MAXLEN.ToString(), jobParams.Maxlen.ToString(), Keywords.ASYNC.ToString()); } else { result = (string)_c.Call( Commands.ADDJOB.ToString(), queueName, job, mstimeout.ToString(), Keywords.REPLICATE.ToString(), jobParams.Replicate.ToString(), Keywords.DELAY.ToString(), jobParams.Delay.ToString(), Keywords.RETRY.ToString(), jobParams.Retry.ToString(), Keywords.TTL.ToString(), jobParams.Ttl.ToString(), Keywords.MAXLEN.ToString(), jobParams.Maxlen.ToString()); } return(result); }
public string AddJob(string queueName, string job, long mstimeout, JobParams jobParams) { //ADDJOB queue_name job <ms-timeout> [REPLICATE <count>] [DELAY <sec>] [RETRY <sec>] [TTL <sec>] [MAXLEN <count>] [ASYNC] string result; if (jobParams.Async) { result = (string)_c.Call( Commands.ADDJOB.ToString(), queueName, job, mstimeout.ToString(), Keywords.REPLICATE.ToString(), jobParams.Replicate.ToString(), Keywords.DELAY.ToString(), jobParams.Delay.ToString(), Keywords.RETRY.ToString(), jobParams.Retry.ToString(), Keywords.TTL.ToString(), jobParams.Ttl.ToString(), Keywords.MAXLEN.ToString(), jobParams.Maxlen.ToString(), Keywords.ASYNC.ToString()); } else { result = (string)_c.Call( Commands.ADDJOB.ToString(), queueName, job, mstimeout.ToString(), Keywords.REPLICATE.ToString(), jobParams.Replicate.ToString(), Keywords.DELAY.ToString(), jobParams.Delay.ToString(), Keywords.RETRY.ToString(), jobParams.Retry.ToString(), Keywords.TTL.ToString(), jobParams.Ttl.ToString(), Keywords.MAXLEN.ToString(), jobParams.Maxlen.ToString()); } return result; }