/// <summary>
 /// Initializes a new instance of the <see cref="EventHandlerRegistry"/> class.
 /// </summary>
 /// <param name="processors">The <see cref="IEventHandlerProcessors"/> that will be used to create instances of <see cref="EventHandlerProcessor{TEventType}"/>.</param>
 /// <param name="policy">The <see cref="IAsyncPolicyFor{T}"/> that defines reconnect policies for event handlers.</param>
 /// <param name="completion">The <see cref="IEventProcessingCompletion"/> that handles waiting for event handlers.</param>
 public EventHandlerRegistry(
     IEventHandlerProcessors processors,
     IAsyncPolicyFor <EventHandlerRegistry> policy,
     IEventProcessingCompletion completion)
 {
     _processors = processors;
     _policy     = policy;
     _completion = completion;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandContextFactory"/> class.
 /// </summary>
 /// <param name="eventStore">The <see cref="IEventStore"/> to use for committing events.</param>
 /// <param name="executionContextManager">A <see cref="IExecutionContextManager"/> for getting execution context from.</param>
 /// <param name="eventHandlersWaiters"><see cref="IEventProcessingCompletion"/> for waiting on event handlers.</param>
 /// <param name="logger"><see cref="ILogger"/> to use for logging.</param>
 public CommandContextFactory(
     IEventStore eventStore,
     IExecutionContextManager executionContextManager,
     IEventProcessingCompletion eventHandlersWaiters,
     ILogger logger)
 {
     _eventStore = eventStore;
     _executionContextManager = executionContextManager;
     _eventHandlersWaiters    = eventHandlersWaiters;
     _logger = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandContext"/> class.
 /// </summary>
 /// <param name="command">The <see cref="CommandRequest">command</see> the context is for.</param>
 /// <param name="executionContext">The <see cref="ExecutionContext"/> for the command.</param>
 /// <param name="eventStore">The <see cref="IEventStore"/> to use for committing events.</param>
 /// <param name="eventProcessingCompletion"><see cref="IEventProcessingCompletion"/> for waiting on event handlers.</param>
 /// <param name="logger"><see cref="ILogger"/> to use for logging.</param>
 public CommandContext(
     CommandRequest command,
     ExecutionContext executionContext,
     IEventStore eventStore,
     IEventProcessingCompletion eventProcessingCompletion,
     ILogger logger)
 {
     Command                    = command;
     ExecutionContext           = executionContext;
     _eventStore                = eventStore;
     _eventProcessingCompletion = eventProcessingCompletion;
     _logger                    = logger;
 }
예제 #4
0
 /// <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="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;
 }