public Worker(IErrorTracker errorTracker, IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, ISerializeMessages serializeMessages, IStoreSagaData storeSagaData, IInspectHandlerPipeline inspectHandlerPipeline, string workerThreadName, IHandleDeferredMessage handleDeferredMessage, IMutateIncomingMessages mutateIncomingMessages) { this.receiveMessages = receiveMessages; this.serializeMessages = serializeMessages; this.mutateIncomingMessages = mutateIncomingMessages; this.errorTracker = errorTracker; dispatcher = new Dispatcher(storeSagaData, activateHandlers, storeSubscriptions, inspectHandlerPipeline, handleDeferredMessage); dispatcher.UncorrelatedMessage += RaiseUncorrelatedMessage; workerThread = new Thread(MainLoop) { Name = workerThreadName }; workerThread.Start(); log.Info("Worker {0} created and inner thread started", WorkerThreadName); }
public Worker(IErrorTracker errorTracker, IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, ISerializeMessages serializeMessages, IStoreSagaData storeSagaData, IInspectHandlerPipeline inspectHandlerPipeline, string workerThreadName, IHandleDeferredMessage handleDeferredMessage, IMutateIncomingMessages mutateIncomingMessages, IStoreTimeouts storeTimeouts, IEnumerable <IUnitOfWorkManager> unitOfWorkManagers, ConfigureAdditionalBehavior configureAdditionalBehavior, MessageLogger messageLogger) { this.receiveMessages = receiveMessages; this.serializeMessages = serializeMessages; this.mutateIncomingMessages = mutateIncomingMessages; this.unitOfWorkManagers = unitOfWorkManagers; this.configureAdditionalBehavior = configureAdditionalBehavior; this.messageLogger = messageLogger; this.errorTracker = errorTracker; dispatcher = new Dispatcher(storeSagaData, activateHandlers, storeSubscriptions, inspectHandlerPipeline, handleDeferredMessage, storeTimeouts); dispatcher.UncorrelatedMessage += RaiseUncorrelatedMessage; nullMessageReceivedBackoffHelper = CreateBackoffHelper(configureAdditionalBehavior.BackoffBehavior); workerThread = new Thread(MainLoop) { Name = workerThreadName }; workerThread.Start(); log.Info("Worker {0} created and inner thread started", WorkerThreadName); }
public DueTimeoutScheduler(IStoreTimeouts storeTimeouts, IHandleDeferredMessage handleDeferredMessage) { this.storeTimeouts = storeTimeouts; this.handleDeferredMessage = handleDeferredMessage; timer.Interval = TimeSpan.FromSeconds(0.3).TotalMilliseconds; timer.Elapsed += CheckCallbacks; log.Info("Starting due timeouts scheduler"); timer.Start(); }
/// <summary> /// Constructs the dispatcher with the specified instances to store and retrieve saga data, /// create message handlers, store and retrieve subscriptions, and to inspect and /// possibly rearrange the handler pipeline. /// </summary> public Dispatcher(IStoreSagaData storeSagaData, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, IInspectHandlerPipeline inspectHandlerPipeline, IHandleDeferredMessage handleDeferredMessage) { this.storeSagaData = storeSagaData; this.activateHandlers = activateHandlers; this.storeSubscriptions = storeSubscriptions; this.inspectHandlerPipeline = inspectHandlerPipeline; this.handleDeferredMessage = handleDeferredMessage; }
/// <summary> /// Constructs the dispatcher with the specified instances to store and retrieve saga data, /// create message handlers, store and retrieve subscriptions, and to inspect and /// possibly rearrange the handler pipeline. /// </summary> public Dispatcher(IStoreSagaData storeSagaData, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, IInspectHandlerPipeline inspectHandlerPipeline, IHandleDeferredMessage handleDeferredMessage, IStoreTimeouts storeTimeouts) { this.storeSagaData = storeSagaData; this.activateHandlers = activateHandlers; this.storeSubscriptions = storeSubscriptions; this.inspectHandlerPipeline = inspectHandlerPipeline; this.handleDeferredMessage = handleDeferredMessage; this.storeTimeouts = storeTimeouts; sagaDataIdPropertyName = Reflect.Path <ISagaData>(s => s.Id); sagaDataPropertyName = Reflect.Path <Saga <ISagaData> >(s => s.Data); }
public TimeoutReplyHandler(IHandleDeferredMessage handleDeferredMessage) { this.handleDeferredMessage = handleDeferredMessage; }
public Worker( IErrorTracker errorTracker, IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, ISerializeMessages serializeMessages, IStoreSagaData storeSagaData, IInspectHandlerPipeline inspectHandlerPipeline, string workerThreadName, IHandleDeferredMessage handleDeferredMessage, IMutateIncomingMessages mutateIncomingMessages, IStoreTimeouts storeTimeouts, IEnumerable<IUnitOfWorkManager> unitOfWorkManagers, ConfigureAdditionalBehavior configureAdditionalBehavior, MessageLogger messageLogger, RebusSynchronizationContext continuations) { this.receiveMessages = receiveMessages; this.serializeMessages = serializeMessages; this.mutateIncomingMessages = mutateIncomingMessages; this.unitOfWorkManagers = unitOfWorkManagers; this.configureAdditionalBehavior = configureAdditionalBehavior; this.messageLogger = messageLogger; this.continuations = continuations; this.errorTracker = errorTracker; dispatcher = new Dispatcher(storeSagaData, activateHandlers, storeSubscriptions, inspectHandlerPipeline, handleDeferredMessage, storeTimeouts); dispatcher.UncorrelatedMessage += RaiseUncorrelatedMessage; nullMessageReceivedBackoffHelper = CreateBackoffHelper(configureAdditionalBehavior.BackoffBehavior); workerThread = new Thread(MainLoop) { Name = workerThreadName }; workerThread.Start(); log.Info("Worker {0} created and inner thread started", WorkerThreadName); }