Exemplo n.º 1
0
 private static void StopSilo()
 {
     _log.Information("Stopping orleans silo host");
     _silo.StopAsync().GetAwaiter().GetResult();
     _silo.Dispose();
     _log.Information("Orleans silo host stopped");
 }
Exemplo n.º 2
0
        public void Stop()
        {
            if (_serviceArguments == null)
            {
                return;
            }

            var cancelAfter = new CancellationTokenSource(TimeSpan.FromSeconds(_serviceArguments.OnStopWaitTimeSec.Value)).Token;

            try
            {
                HttpServiceListener?.Dispose();
            }
            catch (Exception e)
            {
                Log.Warn((m) => m("Failed to close HttpServiceListener ", exception: e));
            }

            try
            {
                _siloHost?.StopAsync(cancelAfter).Wait(cancelAfter);
                _siloHost?.Dispose();
            }
            catch (Exception e)
            {
                Log.Error((m) => m(" Silo failed to StopAsync", exception: e));
            }
        }
Exemplo n.º 3
0
 static void ShutdownSilo()
 {
     if (siloHost == null)
     {
         return;
     }
     siloHost.Dispose();
     GC.SuppressFinalize(siloHost);
     siloHost = null;
 }
        public async Task CleanupTest()
        {
            if (_host != null)
            {
                await _host.StopAsync().ConfigureAwait(false);

                _host.Dispose();
                _host = null;
            }
        }
Exemplo n.º 5
0
        public void Dispose()
        {
            _clusterClient?.Close();
            _clusterClient?.Dispose();

            _siloHost?.StopAsync().Wait();
            _siloHost?.Dispose();

            _siloScope?.Dispose();
        }
Exemplo n.º 6
0
            public async Task StopAsync(CancellationToken cancellationToken)
            {
                if (_siloHost != null)
                {
                    await _siloHost.StopAsync(cancellationToken);

                    await _siloHost.Stopped;
                    _siloHost.Dispose();
                    //_scope.Dispose();
                }
            }
Exemplo n.º 7
0
 public void Dispose()
 {
     _host.Dispose();
 }
Exemplo n.º 8
0
 public void OnStop()
 {
     siloHost?.Dispose();
 }