Exemplo n.º 1
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            _cancellationToken = cancellationToken;
            _observable        = _eventStoreSubscription
                                 .Buffer(TimeSpan.FromMilliseconds(TimeOutInMilliSeconds), BatchSize)
                                 .Where(buffer => buffer.Any())
                                 .Subscribe(ProcessEvent, OnCompleted);

            _eventStoreSubscription.Connect();
            _trace.Info("Observable subscription started.");

            _eventStoreSubscription.Start(cancellationToken, BatchSize);
            return(Task.FromResult(true));
        }
Exemplo n.º 2
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            _cancellationToken = cancellationToken;
            _observable        = _eventStoreSubscription
                                 .Buffer(TimeSpan.FromMilliseconds(_timeoutInMilliseconds), _batchSize)
                                 .Where(buffer => buffer.Any()).Subscribe(x => {}, OnCompleted);
            _eventStoreSubscription.Start(cancellationToken);

            return(Task.FromResult(true));
        }