コード例 #1
0
        private async Task HandleEvent(Message message)
        {
            var eventPublishData = EventPublishDataTransformer.Read(message, _serializerProvider, out var skipLocalEvents);

            if (skipLocalEvents && _serviceResolver.Resolve(eventPublishData.Service).Definition.Type == ServiceType.Local)
            {
                return;
            }

            var communicationMessage = new CommunicationMessage(message);
            await _localTransitionRunner.ReactAsync(eventPublishData, communicationMessage);
        }
コード例 #2
0
        private async Task HandleCommandOrQuery(Message message)
        {
            var invocationData       = MethodInvocationDataTransformer.Read(message, _serializerProvider);
            var communicationMessage = new CommunicationMessage(message);

            TaskCompletionSource <InvokeRoutineResult> tcs = null;

            if (message.Data.TryGetValue("Notification", out var sink))
            {
                tcs = (TaskCompletionSource <InvokeRoutineResult>)sink;
                communicationMessage.WaitForResult = true;
            }

            var result = await _localTransitionRunner.RunAsync(invocationData, communicationMessage);

            tcs?.TrySetResult(result);
        }
コード例 #3
0
 private async Task HandleResponse(Message message)
 {
     var continuationData     = MethodContinuationDataTransformer.Read(message, _serializerProvider);
     var communicationMessage = new CommunicationMessage(message);
     await _localTransitionRunner.ContinueAsync(continuationData, communicationMessage);
 }