Esempio n. 1
0
        public void SubscribeToReader <TEvent>(IStreamingReaderHandler <TEvent> handler)
        {
            Log.Debug("enter SubscribeToReader");
            StreamingReaderRegistration <TEvent> registration = new StreamingReaderRegistration <TEvent>(handler, this.ProcessInboundCallback);

            _envelopeBus.Register(registration);
            Log.Debug("leave SubscribeToReader");
        }
Esempio n. 2
0
        public StreamingReaderRegistration(IStreamingReaderHandler <TEvent> eventHandler, Func <Envelope, object> processorCallback)
        {
            //IStreamingReaderHandler implements IObserver<IStreamingEventItem<TEvent>>
            _observers = new List <IObserver <StreamingEventItem <TEvent> > >();
            _observers.Add(eventHandler);

            _eventHandler      = eventHandler;
            _processorCallback = processorCallback;

            _registrationInfo = new Dictionary <string, string>();
            _registrationInfo.Add(EnvelopeHeaderConstants.MESSAGE_TOPIC, _eventHandler.EventType.FullName);
            _log = LogManager.GetLogger(typeof(StreamingReaderRegistration <TEvent>).Name);
        }