Esempio n. 1
0
        public RabbitMqBus(IBusHost host)
        {
            var factory = new ConnectionFactory
            {
                HostName = host.Host,
                UserName = host.UserName,
                Password = host.Password
            };

            _connection = factory.CreateConnection();
            _channel    = _connection.CreateModel();
            _handlers   = new List <Tuple <string, Func <IModel, EventingBasicConsumer> > >();
        }
Esempio n. 2
0
 public ShutdownHook(IBusHost host)
 {
     this.host = host;
 }
Esempio n. 3
0
        public void OnStop_stops_the_host(TestStartup sut, IBusHost busHost, HostControl control)
        {
            sut.OnStop(busHost, control);

            Mock.Get(busHost).Verify(p => p.StopAsync(), Times.Once);
        }
Esempio n. 4
0
 public ShutdownHook(IBusHost host)
 {
     this.host = host;
 }
Esempio n. 5
0
 public NybusHostedService(IBusHost host, ILogger <NybusHostedService> logger)
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _host   = host ?? throw new ArgumentNullException(nameof(host));
 }
Esempio n. 6
0
 public override bool OnStop(IBusHost host, HostControl control)
 {
     return(base.OnStop(host, control));
 }
Esempio n. 7
0
        public virtual bool OnStop(IBusHost host, HostControl control)
        {
            host.StopAsync().GetAwaiter().GetResult();

            return(true);
        }
Esempio n. 8
0
        public async Task StopAsync_stops_host([Frozen] IBusHost host, NybusHostedService sut, CancellationToken cancellationToken)
        {
            await sut.StopAsync(cancellationToken);

            Mock.Get(host).Verify(p => p.StopAsync());
        }
 public IBusBootstrapper Init(IBusHost host)
 {
     Bus = new RabbitMqBus(host);
     return(this);
 }