Exemplo n.º 1
0
        public async Task OnSubscribed(StreamSubscriptionHandle <IFruit> handle)
        {
            logger.Info("OnAdd");
            this.onAddCalledCount++;
            var observer  = new CounterObserver <IFruit>(this.logger);
            var newhandle = new ExternalStreamSubscriptionHandle <IFruit>(await handle.ResumeAsync(observer)) as IExternalStreamSubscriptionHandle;

            this.consumerHandles.Add(newhandle);
            this.consumerObservers.Add(observer);
        }
Exemplo n.º 2
0
        public async Task OnSubscribed(IStreamSubscriptionHandleFactory handleFactory)
        {
            logger.Info("OnAdd");
            this.onAddCalledCount++;
            var observer  = new CounterObserver <IFruit>(this.logger);
            var newhandle = handleFactory.Create <IFruit>();

            this.consumerHandles.Add(await newhandle.ResumeAsync(observer));
            this.consumerObservers.Add(observer);
        }