コード例 #1
0
 public MessageRouter(
     IDisposable disposer,
     IHandleUnitOfWork unitOfWork,
     ITransportMessages messageTransport,
     ITrackMessageHandlers handlerTable,
     IHandlePoisonMessages poisonMessageHandler)
 {
     this.disposer             = disposer;
     this.unitOfWork           = unitOfWork;
     this.messageTransport     = messageTransport;
     this.handlerTable         = handlerTable;
     this.poisonMessageHandler = poisonMessageHandler;
     this.ContinueProcessing   = true;
 }
コード例 #2
0
 public MessageRouter(
     IDisposable disposer,
     IHandleUnitOfWork unitOfWork,
     ITransportMessages messageTransport,
     ITrackMessageHandlers handlerTable,
     IHandlePoisonMessages poisonMessageHandler)
 {
     this.disposer = disposer;
     this.unitOfWork = unitOfWork;
     this.messageTransport = messageTransport;
     this.handlerTable = handlerTable;
     this.poisonMessageHandler = poisonMessageHandler;
     this.ContinueProcessing = true;
 }
コード例 #3
0
        private static void DispatchCommit(ILifetimeScope container, Commit commit)
        {
            using (var scope = container.BeginLifetimeScope())
            {
                NanoMessageBus.IPublishMessages publisher = scope.Resolve <NanoMessageBus.IPublishMessages>();

                publisher.Publish(commit.Events.Select(e => e.Body).ToArray());

                // need to complete and dispose the uow to do the actual publishing since
                // the IHandleUnitOfWork is registered as ExternalyOwned
                using (IHandleUnitOfWork uow = scope.Resolve <IHandleUnitOfWork>())
                {
                    uow.Complete();
                }
            }
        }
コード例 #4
0
        private static void DispatchCommit(ILifetimeScope container, Commit commit)
        {
            // TODO: the process might crash after the commit has been writen to the eventstore
            // but before we have a chance to publish the messages to the bus.
            using (var scope = container.BeginLifetimeScope())
            {
                NanoMessageBus.IPublishMessages publisher = scope.Resolve <NanoMessageBus.IPublishMessages>();

                publisher.Publish(commit.Events.Select(e => e.Body).ToArray());

                // need to complete and dispose the uow to do the actual publishing since
                // the IHandleUnitOfWork is registered as ExternalyOwned
                using (IHandleUnitOfWork uow = scope.Resolve <IHandleUnitOfWork>())
                {
                    uow.Complete();
                }
            }
        }
コード例 #5
0
 public TransactionalBus(IHandleUnitOfWork unitOfWork, MessageBus inner)
 {
     // Null UoW?
     this.unitOfWork = unitOfWork;
     this.inner = inner;
 }
コード例 #6
0
 public TransactionalBus(IHandleUnitOfWork unitOfWork, MessageBus inner)
 {
     this.unitOfWork = unitOfWork;
     this.inner      = inner;
 }