コード例 #1
0
        public Task <byte[]> InvokeAsync(
            ActorId actorId,
            int interfaceId,
            int methodId,
            string callContext,
            byte[] requestMsgBody,
            CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var methodDispatcher   = this.actorService.MethodDispatcherMap.GetDispatcher(interfaceId, methodId);
            var actorMethodName    = methodDispatcher.GetMethodName(methodId);
            var actorMethodContext = ActorMethodContext.CreateForActor(actorMethodName);

            var deserializationStartTime = DateTime.UtcNow;
            var requestBody = methodDispatcher.DeserializeRequestMessageBody(requestMsgBody);

            this.DiagnosticsEventManager.ActorRequestDeserializationFinish(deserializationStartTime);

            return(this.DispatchToActorAsync(
                       actorId: actorId,
                       actorMethodContext: actorMethodContext,
                       createIfRequired: true,
                       actorFunc:
                       (actor, innerCancellationToken) =>
                       this.ActorMethodDispatch(methodDispatcher, actor, interfaceId, methodId, requestBody, innerCancellationToken),
                       callContext: callContext,
                       timerCall: false,
                       cancellationToken: cancellationToken));
        }
コード例 #2
0
        public Task <IServiceRemotingResponseMessageBody> InvokeAsync(ActorId actorId, int interfaceId, int methodId,
                                                                      string callContext,
                                                                      IServiceRemotingRequestMessageBody requestMsgBody,
                                                                      IServiceRemotingMessageBodyFactory remotingMessageBodyFactory,
                                                                      CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            this.ThrowIfClosed();

            var methodDispatcher   = this.actorService.MethodDispatcherMapV2.GetDispatcher(interfaceId, methodId);
            var actorMethodName    = methodDispatcher.GetMethodName(methodId);
            var actorMethodContext = ActorMethodContext.CreateForActor(actorMethodName);


            return(this.DispatchToActorAsync <IServiceRemotingResponseMessageBody>(
                       actorId: actorId,
                       actorMethodContext: actorMethodContext,
                       createIfRequired: true,
                       actorFunc:
                       (actor, innerCancellationToken) =>
                       this.ActorMethodDispatch(methodDispatcher, actor, interfaceId, methodId, requestMsgBody,
                                                remotingMessageBodyFactory,
                                                innerCancellationToken),
                       callContext: callContext,
                       timerCall: false,
                       cancellationToken: cancellationToken));
        }