コード例 #1
0
ファイル: ConsumerClient.cs プロジェクト: srudaa/Runtime
 /// <summary>
 /// Initializes a new instance of the <see cref="ConsumerClient"/> class.
 /// </summary>
 /// <param name="clientManager">The <see cref="IClientManager" />.</param>
 /// <param name="subscriptions">The <see cref="ISubscriptions" />.</param>
 /// <param name="microservicesConfiguration">The <see cref="MicroservicesConfiguration" />.</param>
 /// <param name="streamProcessorStates">The <see cref="IStreamProcessorStateRepository" />.</param>
 /// <param name="eventHorizonEventsWriter">The <see cref="IWriteEventHorizonEvents" />.</param>
 /// <param name="policy">The <see cref="IAsyncPolicyFor{T}" /> <see cref="ConsumerClient" />.</param>
 /// <param name="eventProcessorPolicy">The <see cref="IAsyncPolicyFor{T}" /> <see cref="EventProcessor" />.</param>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager" />.</param>
 /// <param name="reverseCallClients"><see cref="IReverseCallClients"/>.</param>
 /// <param name="logger">The <see cref="ILogger" />.</param>
 public ConsumerClient(
     IClientManager clientManager,
     ISubscriptions subscriptions,
     MicroservicesConfiguration microservicesConfiguration,
     IStreamProcessorStateRepository streamProcessorStates,
     IWriteEventHorizonEvents eventHorizonEventsWriter,
     IAsyncPolicyFor <ConsumerClient> policy,
     IAsyncPolicyFor <EventProcessor> eventProcessorPolicy,
     IExecutionContextManager executionContextManager,
     IReverseCallClients reverseCallClients,
     ILogger logger)
 {
     _clientManager = clientManager;
     _subscriptions = subscriptions;
     _microservicesConfiguration = microservicesConfiguration;
     _streamProcessorStates      = streamProcessorStates;
     _eventHorizonEventsWriter   = eventHorizonEventsWriter;
     _policy = policy;
     _eventProcessorPolicy    = eventProcessorPolicy;
     _executionContextManager = executionContextManager;
     _logger = logger;
     _cancellationTokenSource = new CancellationTokenSource();
     _cancellationToken       = _cancellationTokenSource.Token;
     _reverseCallClients      = reverseCallClients;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventProcessor"/> class.
 /// </summary>
 /// <param name="consentId">THe <see cref="ConsentId" />.</param>
 /// <param name="subscription">The <see cref="Subscription" />.</param>
 /// <param name="receivedEventsWriter">The <see cref="IWriteEventHorizonEvents" />.</param>
 /// <param name="policies">The <see cref="IEventProcessorPolicies" />.</param>
 /// <param name="metrics">The system for collecting metrics.</param>
 /// <param name="eventStoreClient">The <see cref="EventStoreClient"/>.</param>
 /// <param name="logger">The <see cref="ILogger" />.</param>
 public ExternalEventsCommitter(
     IWriteEventHorizonEvents receivedEventsWriter,
     IEventProcessorPolicies policies,
     EventStoreClient eventStoreClient)
 {
     _receivedEventsWriter = receivedEventsWriter;
     _policies             = policies;
     _eventStoreClient     = eventStoreClient;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventProcessor"/> class.
 /// </summary>
 /// <param name="consentId">THe <see cref="ConsentId" />.</param>
 /// <param name="subscription">The <see cref="Subscription" />.</param>
 /// <param name="receivedEventsWriter">The <see cref="IWriteEventHorizonEvents" />.</param>
 /// <param name="policy">The <see cref="IAsyncPolicyFor{T}" /> <see cref="EventProcessor" />.</param>
 /// <param name="logger">The <see cref="ILogger" />.</param>
 public EventProcessor(
     ConsentId consentId,
     SubscriptionId subscription,
     IWriteEventHorizonEvents receivedEventsWriter,
     IAsyncPolicyFor <EventProcessor> policy,
     ILogger logger)
 {
     _consentId            = consentId;
     Scope                 = subscription.ScopeId;
     Identifier            = subscription.ProducerTenantId.Value;
     _subscriptionId       = subscription;
     _receivedEventsWriter = receivedEventsWriter;
     _policy               = policy;
     _logger               = logger;
 }