Beispiel #1
0
        public virtual async Task Start(CancellationToken cancellationToken = default)
        {
            _received = new BusTestReceiveObserver(TestInactivityTimeout);
            _received.ConnectInactivityObserver(InactivityObserver);

            _consumed = new BusTestConsumeObserver(TestTimeout, InactivityToken);
            _consumed.ConnectInactivityObserver(InactivityObserver);

            _published = new BusTestPublishObserver(TestTimeout, TestInactivityTimeout, InactivityToken);
            _published.ConnectInactivityObserver(InactivityObserver);

            _sent = new BusTestSendObserver(TestTimeout, TestInactivityTimeout, InactivityToken);
            _sent.ConnectInactivityObserver(InactivityObserver);

            PreCreateBus?.Invoke(this);

            BusControl = CreateBus();

            ConnectObservers(BusControl);

            _busHandle = await BusControl.StartAsync(cancellationToken).ConfigureAwait(false);

            BusSendEndpoint = await GetSendEndpoint(BusControl.Address).ConfigureAwait(false);

            InputQueueSendEndpoint = await GetSendEndpoint(InputQueueAddress).ConfigureAwait(false);

            InputQueueSendEndpoint.ConnectSendObserver(_sent);

            BusControl.ConnectConsumeObserver(_consumed);
            BusControl.ConnectPublishObserver(_published);
            BusControl.ConnectReceiveObserver(_received);
            BusControl.ConnectSendObserver(_sent);
        }
Beispiel #2
0
        public virtual async Task Start()
        {
            _consumed = new BusTestConsumeObserver(TestTimeout, InactivityToken);
            _consumed.ConnectInactivityObserver(InactivityObserver);

            _published = new BusTestPublishObserver(TestTimeout, TestInactivityTimeout, InactivityToken);
            _published.ConnectInactivityObserver(InactivityObserver);

            _sent = new BusTestSendObserver(TestTimeout, TestInactivityTimeout, InactivityToken);
            _sent.ConnectInactivityObserver(InactivityObserver);

            Mediator = CreateMediator();

            Mediator.ConnectConsumeObserver(_consumed);
            Mediator.ConnectPublishObserver(_published);
            Mediator.ConnectSendObserver(_sent);
        }