Ejemplo n.º 1
0
 public static IDisposable RegisterEnumerableHandler <TMessageRequest, TMessageResponse>(this INetworkBus bus, IEnumerableMessageHandler <TMessageRequest, TMessageResponse> handler, Guid?referenceId = null)
     where TMessageRequest : notnull, IMessage, new()
     where TMessageResponse : notnull, IEnumerableMessage, new()
 {
     return(bus.SubscribeAndReplyEnumerable <TMessageRequest, TMessageResponse>(handler.HandleAsync, referenceId));
 }
Ejemplo n.º 2
0
 public static IDisposable SubscribeAndReplyEnumerable <TMessageRequest, TMessageResponse>(this INetworkBus bus, Func <TMessageRequest, IAsyncEnumerable <TMessageResponse> > func, Guid?referenceId)
     where TMessageRequest : notnull, IMessage, new()
     where TMessageResponse : notnull, IEnumerableMessage, new()
 {
     return(bus.SubscribeAndReplyEnumerable <TMessageRequest, TMessageResponse>(message => func(message).ToEnumerable(), referenceId));
 }