Пример #1
0
 public IService RegisterSendHandler <TRequest>(
     string method, Func <TRequest, Task> handler, ServiceDelegates.SpanDeserializer requestDeserializer
     )
 {
     RequestDeserializers.Add(method, requestDeserializer);
     SendHandlers.Add(method, async(message) => { await handler((TRequest)message); });
     AddMethodHash(method);
     return(this);
 }
Пример #2
0
 public IService RegisterRequest <TRequest, TResponse>(
     string method,
     ServiceDelegates.SpanSerializer requestSerializer,
     ServiceDelegates.SpanDeserializer responseDeserializer
     )
 {
     RequestSerializers.Add(method, requestSerializer);
     ResponseDeserializers.Add(method, responseDeserializer);
     AddMethodHash(method);
     return(this);
 }
Пример #3
0
 public IService RegisterRequestHandler <TRequest, TResponse>(
     string method,
     Func <TRequest, Task <TResponse> > handler,
     ServiceDelegates.SpanDeserializer requestDeserializer,
     ServiceDelegates.SpanSerializer responseSerializer
     )
 {
     RequestDeserializers.Add(method, requestDeserializer);
     ResponseSerializers.Add(method, responseSerializer);
     RequestHandlers.Add(method, async(message) => { return(await handler((TRequest)message)); });
     AddMethodHash(method);
     return(this);
 }