private void EnqueueTaskForCompletion(CancellationToken token, Task<IActorResult> task, Message messageIn) { var asyncMessageContext = new AsyncMessageContext { OutMessages = CreateTaskResultMessage(task).Messages, CallbackIdentity = GetTaskCallbackIdentity(task, messageIn), CallbackReceiverIdentity = messageIn.CallbackReceiverIdentity, CorrelationId = messageIn.CorrelationId, MessageHops = messageIn.GetMessageHops() }; asyncQueue.Enqueue(asyncMessageContext, token); }
private static bool IsAsyncMessage(AsyncMessageContext amc) { return Unsafe.Equals(amc.OutMessages.First().Identity, AsyncMessage.MessageIdentity); }