public TaskPayloadCollection(string codeName, IEnumerable<string> payloads, TaskOptions options = null)
 {
     foreach (string payload in payloads)
     {
         Tasks.Add(new TaskPayload(codeName, payload, options));
     }
 }
 public TaskPayloadCollection(string codeName, IEnumerable <string> payloads, TaskOptions options = null)
 {
     foreach (string payload in payloads)
     {
         Tasks.Add(new TaskPayload(codeName, payload, options));
     }
 }
Example #3
0
        public TaskPayload(string codeName, string payload, TaskOptions options = null)
        {
            CodeName = codeName;
            Payload = payload;

            if (options == null) return;

            Timeout = options.Timeout;
            Delay = options.Delay;
            Priority = options.Priority;
        }
Example #4
0
        public TaskPayload(string codeName, string payload, TaskOptions options = null)
        {
            CodeName = codeName;
            Payload  = payload;

            if (options == null)
            {
                return;
            }

            Timeout  = options.Timeout;
            Delay    = options.Delay;
            Priority = options.Priority;
        }
Example #5
0
 public async Task <TaskIdCollection> Create(string codeName, IEnumerable <string> payloads, TaskOptions options = null)
 {
     return(await Create(new TaskPayloadCollection(codeName, payloads, options)));
 }
Example #6
0
 public async Task <TaskIdCollection> Create(string codeName, IEnumerable <object> payloads, TaskOptions options = null)
 {
     return(await Create(codeName, payloads.Select(ValueSerializer.Generate), options));
 }
Example #7
0
 /// <summary>
 ///     Creates a single task
 /// </summary>
 /// <param name="codeName"> The task Code Name </param>
 /// <param name="payload"> The task payload </param>
 /// <param name="options"> The task options </param>
 /// <returns> The task id </returns>
 public async Task <string> Create(string codeName, string payload, TaskOptions options = null)
 {
     return(await Create(new TaskPayload(codeName, payload, options)));
 }
Example #8
0
 /// <summary>
 ///     Creates a single task
 /// </summary>
 /// <param name="codeName"> The task Code Name </param>
 /// <param name="payload"> The task payload </param>
 /// <param name="options"> The task options </param>
 /// <returns> The task id </returns>
 public async Task <string> Create(string codeName, object payload, TaskOptions options = null)
 {
     return(await Create(codeName, ValueSerializer.Generate(payload), options));
 }
 public TaskPayloadCollection(string codeName, string payload, TaskOptions options = null)
 {
     Tasks.Add(new TaskPayload(codeName, payload, options));
 }
Example #10
0
 public TaskPayloadCollection(string codeName, string payload, TaskOptions options = null)
 {
     Tasks.Add(new TaskPayload(codeName, payload, options));
 }
Example #11
0
 /// <summary>
 /// Creates a single task
 /// </summary>
 /// <param name="codeName"> The task Code Name </param>
 /// <param name="payload"> The task payload </param>
 /// <param name="options"> The task options </param>
 /// <returns> The task id </returns>
 public string Create(string codeName, string payload, TaskOptions options = null)
 {
     return(Create(new TaskPayload(codeName, payload, options)));
 }
Example #12
0
 /// <summary>
 /// Creates a single task
 /// </summary>
 /// <param name="codeName"> The task Code Name </param>
 /// <param name="payload"> The task payload </param>
 /// <param name="options"> The task options </param>
 /// <returns> The task id </returns>
 public string Create(string codeName, object payload, TaskOptions options = null)
 {
     return(Create(codeName, ValueSerializer.Generate(payload), options));
 }
Example #13
0
 public TaskIdCollection Create(string codeName, IEnumerable<string> payloads, TaskOptions options = null)
 {
     return Create(new TaskPayloadCollection(codeName, payloads, options));
 }
Example #14
0
 public TaskIdCollection Create(string codeName, IEnumerable<object> payloads, TaskOptions options = null)
 {
     return Create(codeName, payloads.Select(ValueSerializer.Generate), options);
 }
Example #15
0
 /// <summary>
 /// Creates a single task
 /// </summary>
 /// <param name="codeName"> The task Code Name </param>
 /// <param name="payload"> The task payload </param>
 /// <param name="options"> The task options </param>
 /// <returns> The task id </returns>
 public string Create(string codeName, string payload, TaskOptions options = null)
 {
     return Create(new TaskPayload(codeName, payload, options));
 }
Example #16
0
 /// <summary>
 /// Creates a single task
 /// </summary>
 /// <param name="codeName"> The task Code Name </param>
 /// <param name="payload"> The task payload </param>
 /// <param name="options"> The task options </param>
 /// <returns> The task id </returns>
 public string Create(string codeName, object payload, TaskOptions options = null)
 {
     return Create(codeName, ValueSerializer.Generate(payload), options);
 }