/// <summary> /// Internal execute function to be called asynchronously. /// </summary> /// <param id="state">The server state object associated with the execution.</param> private static void execute(ServerState state) { Interlocked.Increment(ref runningJobs); //get the execution context SerializationEngine serializer = new SerializationEngine (); Transfers.ExecutionContext context = (Transfers.ExecutionContext)serializer.Deserialize(state.GetDataArray()); byte[] res = DomainManager.ExecuteIncoming(context); Transfers.ExecutionResult result = new Transfers.ExecutionResult(res, context.ContextID, context.DomainKey, ClusterManager.NodeID); state.Write(MessageType.EXECUTION_COMPLETE, serializer.Serialize(result)); Interlocked.Decrement(ref runningJobs); }
/// <summary> /// Internal execute function to be called asynchronously. /// </summary> /// <param id="state">The server state object associated with the execution.</param> private static void execute(ServerState state) { Interlocked.Increment(ref runningJobs); //get the execution context SerializationEngine serializer = new SerializationEngine(); Transfers.ExecutionContext context = (Transfers.ExecutionContext)serializer.Deserialize(state.GetDataArray()); byte[] res = DomainManager.ExecuteIncoming(context); Transfers.ExecutionResult result = new Transfers.ExecutionResult(res, context.ContextID, context.DomainKey, ClusterManager.NodeID); state.Write(MessageType.EXECUTION_COMPLETE, serializer.Serialize(result)); Interlocked.Decrement(ref runningJobs); }
/// <summary> /// Return an execution from the cluster and give it back to the correct domain. /// </summary> /// <param name="result">The Result object of the execution.</param> public static void ReturnExecution(ExecutionResult result) { DomainProxy proxy = proxies[result.DomainKey]; Node executor = Nodes.GetNodeByID(result.ExecutingNodeID); proxy.ReturnExecution(result.ContextID, executor, result.Result); }