Esempio n. 1
0
        public override void Invoke(TypedHyperSocket socket, ILetter letter, Metadata metadata, Type concreteType, IReceivedEventArgs receivedEventArgs)
        {
            var message    = _serializer.Deserialize <TMessage>(letter.Parts[1], concreteType);
            var answerable = new Answerable <TMessage>(_socket, message, receivedEventArgs.RemoteNodeId, metadata.ConversationId);

            _callback(socket, answerable);
        }
        public override void SetResult(Metadata metadata, ILetter letter, IReceivedEventArgs receivedEventArgs)
        {
            var result = _socket.Serializer.Deserialize <TResult>(letter.Parts[1], Type.GetType(metadata.Type));

            Result = new Answerable <TResult>(_socket, result, receivedEventArgs.RemoteNodeId, metadata.ConversationId);
            _waitLock.Set();
        }
        public override void Invoke(TypedHyperSocket socket, ILetter letter, Metadata metadata, Type concreteType, IReceivedEventArgs receivedEventArgs)
        {
            var message    = _serializer.Deserialize <TMessage>(letter.Parts[1], concreteType);
            var answerable = new Answerable <TMessage>(_socket, message, receivedEventArgs.RemoteNodeId, metadata.ConversationId);
            ITypedHandler <TMessage> handler = _handlerFactory.CreateHandler <THandler, TMessage>(message);

            handler.Execute(_socket, answerable);
        }