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

            _envelopeBus.Register(registration);
            Log.Debug("leave SubscribetoCollection");
        }
        public StreamingCollectionRegistration(IStreamingCollectionHandler <TEvent> handler, Func <Envelope, object> processorCallback)
        {
            _eventHandler     = handler;
            _processInbound   = processorCallback;
            _registrationInfo = new Dictionary <string, string>();
            _registrationInfo.SetMessageTopic(handler.EventType.FullName);

            _log             = LogManager.GetLogger(this.GetType());
            _collectedEvents = new Dictionary <string, IDictionary <int, StreamingEventItem <TEvent> > >();
            _collectionSizes = new Dictionary <string, int>();
        }