/// <summary> /// Returns an execution job to the cluster object to be dispatched to the calling module. /// </summary> /// <param id="result">The execution result object.</param> internal static void ReturnExecution(string contextID, PrestoResult result) { //get the callback Action <PrestoResult> callback; outboundJobs.TryRemove(contextID, out callback); //invoke the callback callback(result); returnCallbackCleanup(contextID); }
/// <summary> /// Returns an execution job to the cluster object to be dispatched to the calling module. /// </summary> /// <param id="result">The execution result object.</param> internal static void ReturnExecution(string contextID, PrestoResult result) { //get the callback Action<PrestoResult> callback; outboundJobs.TryRemove(contextID, out callback); //invoke the callback callback(result); returnCallbackCleanup(contextID); }
//The callback called after the function completes. public static void callback(PrestoResult result) { FunctionOutput output = (FunctionOutput)result; Console.WriteLine("Execution number: " + output.value + " from node id: " + output.ExecutionNode.HostName); System.Threading.Interlocked.Increment(ref numjobs); }