예제 #1
0
        public async virtual Task BecomeConsumer(Guid streamId, string providerToUse, string streamNamespace)
        {
            _providerToUse = providerToUse;
            ConsumerObserver consumerObserver = ConsumerObserver.NewObserver(_logger);
            await consumerObserver.BecomeConsumer(streamId, this.GetStreamProvider(providerToUse), streamNamespace);

            _observers.Add(consumerObserver);
        }
예제 #2
0
        public async Task BecomeConsumer(Guid streamGuid, string providerToUse, string streamNamespace)
        {
            if (_observers.ContainsKey(providerToUse))
            {
                throw new InvalidOperationException(string.Format("consumer already established for provider {0}.", providerToUse));
            }

            if (string.IsNullOrWhiteSpace(streamNamespace))
            {
                throw new ArgumentException("namespace is required (must not be null or whitespace)", "streamNamespace");
            }

            ConsumerObserver consumerObserver = ConsumerObserver.NewObserver(_logger);
            await consumerObserver.BecomeConsumer(streamGuid, this.GetStreamProvider(providerToUse), streamNamespace);

            _observers[providerToUse] = consumerObserver;
        }
예제 #3
0
 public async Task BecomeConsumer(Guid streamId, string providerToUse, string streamNamespace)
 {
     _providerToUseForConsumer = providerToUse;
     _consumer = ConsumerObserver.NewObserver(this._logger);
     await _consumer.BecomeConsumer(streamId, this.GetStreamProvider(providerToUse), streamNamespace);
 }