コード例 #1
0
        public Task OnSubscribed(IStreamSubscriptionHandleFactory handleFactory)
        {
            StreamSubscriptionHandle <string> handle = handleFactory.Create <string>();

            return((handle.StreamId.GetNamespace() == StreamBatchingTestConst.BatchingNameSpace)
                ? handle.ResumeAsync(OnNextBatch)
                : handle.ResumeAsync(OnNext));
        }
コード例 #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);
        }
コード例 #3
0
 //Jerk_ConsumerGrai would unsubscrube on any subscription added to it
 public async Task OnSubscribed(IStreamSubscriptionHandleFactory handleFactory)
 {
     var handle = handleFactory.Create <int>();
     await handle.UnsubscribeAsync();
 }
コード例 #4
0
        /// <summary>
        /// Initialize Stream Subscription
        /// </summary>
        /// <param name="handleFactory">stream factory</param>
        public Task OnSubscribed(IStreamSubscriptionHandleFactory handleFactory)
        {
            var handle = handleFactory.Create <int>();

            return(handle.ResumeAsync(observer));
        }
コード例 #5
0
 public async Task OnSubscribed(IStreamSubscriptionHandleFactory handleFactory)
 {
     // Plug our LoggerObserver to the stream
     var handle = handleFactory.Create <ISensorTelemetryEntity>();
     await handle.ResumeAsync(this);
 }
コード例 #6
0
 public async Task OnSubscribed(IStreamSubscriptionHandleFactory handleFactory)
 {
     var handle = handleFactory.Create <string>();
     await handle.ResumeAsync(observer);
 }
コード例 #7
0
 // Called when a subscription is added
 public async Task OnSubscribed(IStreamSubscriptionHandleFactory handleFactory)
 {
     // Plug our LoggerObserver to the stream
     var handle = handleFactory.Create <int>();
     await handle.ResumeAsync(_observer);
 }