Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScopedStreamProcessor"/> class.
 /// </summary>
 /// <param name="tenantId">The <see cref="TenantId"/>.</param>
 /// <param name="streamProcessorId">The <see cref="IStreamProcessorId" />.</param>
 /// <param name="sourceStreamDefinition">The source stream <see cref="IStreamDefinition" />.</param>
 /// <param name="initialState">The <see cref="StreamProcessorState" />.</param>
 /// <param name="processor">An <see cref="IEventProcessor" /> to process the event.</param>
 /// <param name="streamProcessorStates">The <see cref="IResilientStreamProcessorStateRepository" />.</param>
 /// <param name="eventsFromStreamsFetcher">The<see cref="ICanFetchEventsFromStream" />.</param>
 /// <param name="executionContext">The <see cref="ExecutionContext"/> of the stream processor.</param>
 /// <param name="eventFetcherPolicies">The policies to use while fetching events.</param>
 /// <param name="eventWatcher">The <see cref="IStreamEventWatcher" /> to wait for events to be available in stream.</param>
 /// <param name="timeToRetryGetter">The <see cref="ICanGetTimeToRetryFor{T}" /> <see cref="StreamProcessorState" />.</param>
 /// <param name="logger">An <see cref="ILogger" /> to log messages.</param>
 public ScopedStreamProcessor(
     TenantId tenantId,
     IStreamProcessorId streamProcessorId,
     IStreamDefinition sourceStreamDefinition,
     StreamProcessorState initialState,
     IEventProcessor processor,
     IResilientStreamProcessorStateRepository streamProcessorStates,
     ICanFetchEventsFromStream eventsFromStreamsFetcher,
     ExecutionContext executionContext,
     IEventFetcherPolicies eventFetcherPolicies,
     IStreamEventWatcher eventWatcher,
     ICanGetTimeToRetryFor <StreamProcessorState> timeToRetryGetter,
     ILogger logger)
     : base(tenantId, streamProcessorId, sourceStreamDefinition, initialState, processor, eventsFromStreamsFetcher, executionContext, eventFetcherPolicies, eventWatcher, logger)
 {
     _streamProcessorStates = streamProcessorStates;
     _timeToRetryGetter     = timeToRetryGetter;
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScopedStreamProcessor"/> class.
 /// </summary>
 /// <param name="tenantId">The <see cref="TenantId"/>.</param>
 /// <param name="streamProcessorId">The <see cref="IStreamProcessorId" />.</param>
 /// <param name="sourceStreamDefinition">The source stream <see cref="StreamDefinition" />.</param>
 /// <param name="initialState">The <see cref="StreamProcessorState" />.</param>
 /// <param name="processor">An <see cref="IEventProcessor" /> to process the event.</param>
 /// <param name="streamProcessorStates">The <see cref="IResilientStreamProcessorStateRepository" />.</param>
 /// <param name="eventsFromStreamsFetcher">The<see cref="ICanFetchEventsFromStream" />.</param>
 /// <param name="executionContext">The <see cref="ExecutionContext"/> of the stream processor.</param>
 /// <param name="failingPartitionsFactory">The factory to use to create the <see cref="IFailingPartitions" />.</param>
 /// <param name="eventFetcherPolicies">The policies to use while fetching events.</param>
 /// <param name="streamWatcher">The <see cref="IStreamEventWatcher" />.</param>
 /// <param name="timeToRetryGetter">The <see cref="ICanGetTimeToRetryFor{T}" /> <see cref="StreamProcessorState" />.</param>
 /// <param name="logger">An <see cref="ILogger" /> to log messages.</param>
 public ScopedStreamProcessor(
     TenantId tenantId,
     IStreamProcessorId streamProcessorId,
     IStreamDefinition sourceStreamDefinition,
     StreamProcessorState initialState,
     IEventProcessor processor,
     IResilientStreamProcessorStateRepository streamProcessorStates,
     ICanFetchEventsFromPartitionedStream eventsFromStreamsFetcher,
     ExecutionContext executionContext,
     Func <IEventProcessor, ICanFetchEventsFromPartitionedStream, Func <StreamEvent, ExecutionContext>, IFailingPartitions> failingPartitionsFactory,
     IEventFetcherPolicies eventFetcherPolicies,
     IStreamEventWatcher streamWatcher,
     ICanGetTimeToRetryFor <StreamProcessorState> timeToRetryGetter,
     ILogger logger)
     : base(tenantId, streamProcessorId, sourceStreamDefinition, initialState, processor, eventsFromStreamsFetcher, executionContext, eventFetcherPolicies, streamWatcher, logger)
 {
     _streamProcessorStates = streamProcessorStates;
     _failingPartitions     = failingPartitionsFactory(processor, eventsFromStreamsFetcher, GetExecutionContextForEvent);
     _timeToRetryGetter     = timeToRetryGetter;
 }