public void EndJob(string nodeName, EndJobArg arg, NodeCommunicatorCallBack <EndJobArg> callback) { this.SendRequest("endjob", this.GetCallbackUri(nodeName, "taskcompleted"), nodeName, async(content, ex) => { Exception readEx = null; try { if (content != null && ex == null) { arg.JobInfo = await content.ReadAsAsync <ComputeClusterJobInformation>(); } } catch (Exception e) { this.Tracer.TraceError("Exception while read the task info {0}", e); readEx = e; } if (ex != null && readEx != null) { ex = new AggregateException(ex, readEx); } else { ex = ex ?? readEx; } callback(nodeName, arg, ex); }, arg); }
public async Tasks.Task <string> EndJobAsync(string nodeName, EndJobArg arg, CancellationToken token) { return(await this.SendRequestAsync("endjob", this.GetCallbackUri(nodeName, "taskcompleted"), nodeName, arg, 0, token)); }