UnsubscribeAction IResponseHandler.Connect(IInboundPipelineConfigurator configurator) { var connector = new RequestHandlerSubscriptionConnector <TResponse>(); HandlerSelector <TResponse> handler = HandlerSelector.ForContextHandler <TResponse>(HandleResponse); return(connector.Connect(configurator, _requestId, handler)); }
/// <summary> /// Adds a message handler to the service bus for handling a specific type of message /// </summary> /// <typeparam name="T">The message type to handle, often inferred from the callback specified</typeparam> /// <param name="bus"></param> /// <param name="handler">The callback to invoke when messages of the specified type arrive on the service bus</param> public static UnsubscribeAction SubscribeContextHandler <T>(this IServiceBus bus, Action <IConsumeContext <T> > handler) where T : class { return(SubscribeHandlerSelector(bus, HandlerSelector.ForContextHandler(handler))); }