コード例 #1
0
ファイル: StreamingGrain.cs プロジェクト: dotnet/orleans
        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
ファイル: StreamingGrain.cs プロジェクト: dotnet/orleans
        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
ファイル: StreamingGrain.cs プロジェクト: dotnet/orleans
 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);
 }