Exemplo n.º 1
0
 public SubscriptionResult(
     IEventStream eventStream,
     Func <IEventMessage, IExecutionContext> contextFactory,
     ExecuteSubscriptionQuery executeQuery)
 {
     _eventStream = eventStream
                    ?? throw new ArgumentNullException(nameof(eventStream));
     _contextFactory = contextFactory
                       ?? throw new ArgumentNullException(nameof(contextFactory));
     _executeQuery = executeQuery
                     ?? throw new ArgumentNullException(nameof(executeQuery));
 }
Exemplo n.º 2
0
 public SubscriptionResult(
     IAsyncEnumerable <object> sourceStream,
     Func <object, IExecutionContext> contextFactory,
     ExecuteSubscriptionQuery executeQuery,
     IRequestServiceScope serviceScope,
     CancellationToken cancellationToken)
 {
     _enumerator = new SubscriptionResultEnumerator(
         sourceStream,
         contextFactory,
         executeQuery,
         serviceScope,
         cancellationToken);
 }
Exemplo n.º 3
0
 public SubscriptionResultEnumerator(
     IAsyncEnumerable <object> sourceStream,
     Func <object, IExecutionContext> contextFactory,
     ExecuteSubscriptionQuery executeQuery,
     IRequestServiceScope serviceScope,
     CancellationToken cancellationToken)
 {
     _sourceStream = sourceStream
                     .WithCancellation(cancellationToken)
                     .GetAsyncEnumerator();
     _contextFactory    = contextFactory;
     _executeQuery      = executeQuery;
     _serviceScope      = serviceScope;
     _cancellationToken = cancellationToken;
     serviceScope.HandleLifetime();
 }
Exemplo n.º 4
0
 public SubscriptionResult(
     IEventStream eventStream,
     Func <IEventMessage, IExecutionContext> contextFactory,
     ExecuteSubscriptionQuery executeQuery,
     IRequestServiceScope serviceScope)
 {
     _eventStream = eventStream
                    ?? throw new ArgumentNullException(nameof(eventStream));
     _contextFactory = contextFactory
                       ?? throw new ArgumentNullException(nameof(contextFactory));
     _executeQuery = executeQuery
                     ?? throw new ArgumentNullException(nameof(executeQuery));
     _serviceScope = serviceScope
                     ?? throw new ArgumentNullException(nameof(serviceScope));
     _serviceScope.HandleLifetime();
 }