/// <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; }
/// <summary> /// Initializes a new instance of the <see cref="EventHorizonConnectionFactory"/> class. /// </summary> /// <param name="reverseCallClients">The reverse call clients to use for creating event horizon clients.</param> /// <param name="metrics">The system for collecting metrics.</param> /// <param name="loggerFactory">The logger factory to use for creating loggers for the event horizon connections</param> public EventHorizonConnectionFactory( IReverseCallClients reverseCallClients, IMetricsCollector metrics, ILoggerFactory loggerFactory) { _reverseCallClients = reverseCallClients; _metrics = metrics; _loggerFactory = loggerFactory; }
/// <summary> /// Initializes a new instance of the <see cref="FilterProcessors"/> class. /// </summary> /// <param name="client">The <see cref="FiltersClient"/> to use to connect to the Runtime.</param> /// <param name="reverseCallClients">The <see cref="IReverseCallClients"/> to use for creating instances of <see cref="IReverseCallClient{TClientMessage, TServerMessage, TConnectArguments, TConnectResponse, TRequest, TResponse}"/>.</param> /// <param name="converter">The <see cref="IEventConverter"/> to use to convert events.</param> /// <param name="loggerManager">The <see cref="ILoggerManager"/> to use for creating instances of <see cref="ILogger"/>.</param> public FilterProcessors( FiltersClient client, IReverseCallClients reverseCallClients, IEventConverter converter, ILoggerManager loggerManager) { _client = client; _reverseCallClients = reverseCallClients; _converter = converter; _loggerManager = loggerManager; }
/// <summary> /// Initializes a new instance of the <see cref="PublicEventFilterProcessor"/> class. /// </summary> /// <param name="filterId">The unique <see cref="FilterId"/> for the event filter.</param> /// <param name="client">The <see cref="FiltersClient"/> to use to connect to the Runtime.</param> /// <param name="reverseCallClients">The <see cref="IReverseCallClients"/> to use for creating instances of <see cref="IReverseCallClient{TClientMessage, TServerMessage, TConnectArguments, TConnectResponse, TRequest, TResponse}"/>.</param> /// <param name="filter">The <see cref="ICanFilterPublicEvents"/> to use for filtering the events.</param> /// <param name="converter">The <see cref="IEventConverter"/> to use to convert events.</param> /// <param name="logger">The <see cref="ILogger"/> to use for logging.</param> public PublicEventFilterProcessor( FilterId filterId, FiltersClient client, IReverseCallClients reverseCallClients, ICanFilterPublicEvents filter, IEventConverter converter, ILogger logger) : base(filterId, converter, logger) { _client = client; _reverseCallClients = reverseCallClients; _filter = filter; }
/// <summary> /// Initializes a new instance of the <see cref="EventHandlerProcessors"/> class. /// </summary> /// <param name="handlersClient">The <see cref="EventHandlersClient"/> to use to connect to the Runtime.</param> /// <param name="reverseCallClients">The <see cref="IReverseCallClients"/> to use for creating instances of <see cref="IReverseCallClient{TClientMessage, TServerMessage, TConnectArguments, TConnectResponse, TRequest, TResponse}"/>.</param> /// <param name="eventProcessingCompletion">The <see cref="IEventProcessingCompletion"/> to use for notifying of event handling completion.</param> /// <param name="artifactTypeMap">The <see cref="IArtifactTypeMap"/> to use for converting event types to artifacts.</param> /// <param name="converter">The <see cref="IEventConverter"/> to use to convert events.</param> /// <param name="loggerManager">The <see cref="ILoggerManager"/> to use for creating instances of <see cref="ILogger"/>.</param> public EventHandlerProcessors( EventHandlersClient handlersClient, IReverseCallClients reverseCallClients, IEventProcessingCompletion eventProcessingCompletion, IArtifactTypeMap artifactTypeMap, IEventConverter converter, ILoggerManager loggerManager) { _handlersClient = handlersClient; _reverseCallClients = reverseCallClients; _eventProcessingCompletion = eventProcessingCompletion; _artifactTypeMap = artifactTypeMap; _converter = converter; _loggerManager = loggerManager; }
/// <summary> /// Initializes a new instance of the <see cref="EventFilterWithPartitionsProcessor"/> class. /// </summary> /// <param name="filterId">The unique <see cref="FilterId"/> for the event filter.</param> /// <param name="scope">The <see cref="ScopeId"/> of the scope in the Event Store where the filter will run.</param> /// <param name="client">The <see cref="FiltersClient"/> to use to connect to the Runtime.</param> /// <param name="reverseCallClients">The <see cref="IReverseCallClients"/> to use for creating instances of <see cref="IReverseCallClient{TClientMessage, TServerMessage, TConnectArguments, TConnectResponse, TRequest, TResponse}"/>.</param> /// <param name="filter">The <see cref="ICanFilterEventsWithPartition"/> to use for filtering the events.</param> /// <param name="converter">The <see cref="IEventConverter"/> to use to convert events.</param> /// <param name="logger">The <see cref="ILogger"/> to use for logging.</param> public EventFilterWithPartitionsProcessor( FilterId filterId, ScopeId scope, FiltersClient client, IReverseCallClients reverseCallClients, ICanFilterEventsWithPartition filter, IEventConverter converter, ILogger logger) : base(filterId, converter, logger) { _scope = scope; _client = client; _reverseCallClients = reverseCallClients; _filter = filter; }
/// <summary> /// Initializes a new instance of the <see cref="EventHandlerProcessor{TEventType}"/> class. /// </summary> /// <param name="handlerId">The unique <see cref="EventHandlerId"/> for the event handler.</param> /// <param name="scope">The <see cref="ScopeId"/> of the scope in the Event Store where the event handler will run.</param> /// <param name="partitioned">Whether the event handler should create a partitioned stream or not.</param> /// <param name="handler">The <see cref="IEventHandler{TEventType}"/> that will be called to handle incoming events.</param> /// <param name="client">The <see cref="EventHandlersClient"/> to use to connect to the Runtime.</param> /// <param name="reverseCallClients">The <see cref="IReverseCallClients"/> to use for creating instances of <see cref="IReverseCallClient{TClientMessage, TServerMessage, TConnectArguments, TConnectResponse, TRequest, TResponse}"/>.</param> /// <param name="completion">The <see cref="IEventProcessingCompletion"/> to use for notifying of event handling completion.</param> /// <param name="artifacts">The <see cref="IArtifactTypeMap"/> to use for converting event types to artifacts.</param> /// <param name="converter">The <see cref="IEventConverter"/> to use to convert events.</param> /// <param name="logger">The <see cref="ILogger"/> to use for logging.</param> public EventHandlerProcessor( EventHandlerId handlerId, ScopeId scope, bool partitioned, IEventHandler <TEventType> handler, EventHandlersClient client, IReverseCallClients reverseCallClients, IEventProcessingCompletion completion, IArtifactTypeMap artifacts, IEventConverter converter, ILogger logger) : base(logger) { Identifier = handlerId; _scope = scope; _partitioned = partitioned; _handler = handler; _client = client; _reverseCallClients = reverseCallClients; _completion = completion; _artifacts = artifacts; _converter = converter; _logger = logger; }