public void Add <TRequest, TResponse>(RequestBus <TRequest, TResponse> .RequestHandler requestHandler)
 {
     lock (_subscriptions)
     {
         _subscriptions.Add(new RequestSubscription <TRequest, TResponse>(requestHandler));
     }
 }
Beispiel #2
0
        protected ConfigurationBasedService()
        {
            _configuration = RequestBus <GetCurrentConfigurationRequest, IConfiguration> .Post(new GetCurrentConfigurationRequest()) ?? DefaultConfiguration.Instance;

            _configurationUpdatedEventSubscription = new EventSubscription <ConfigurationUpdatedEvent>(OnConfigurationUpdatedInternal);
        }
 public void Dispose()
 {
     RequestBus <TRequest, TResponse> .RemoveResponder(_requestHandler);
 }
 public RequestSubscription(RequestBus <TRequest, TResponse> .RequestHandler requestHandler)
 {
     _requestHandler = requestHandler;
     RequestBus <TRequest, TResponse> .AddResponder(_requestHandler);
 }