コード例 #1
0
ファイル: Worker.cs プロジェクト: rasmuskl/Rebus
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: DueTimeoutScheduler.cs プロジェクト: nls75/Rebus
 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();
 }
コード例 #4
0
        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();
        }
コード例 #5
0
ファイル: Dispatcher.cs プロジェクト: ssboisen/Rebus
 /// <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;
 }
コード例 #6
0
ファイル: Dispatcher.cs プロジェクト: snowattitudes/Rebus
 /// <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);
 }
コード例 #7
0
ファイル: TimeoutReplyHandler.cs プロジェクト: kcsdecos/Rebus
 public TimeoutReplyHandler(IHandleDeferredMessage handleDeferredMessage)
 {
     this.handleDeferredMessage = handleDeferredMessage;
 }
コード例 #8
0
ファイル: Worker.cs プロジェクト: pruiz/Rebus
        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);
        }