public static IDisposable Run(string[] args) { var configuration = ConreignSiloConfiguration.Load( ApplicationPath.CurrentDirectory, args ); var silo = ConreignSilo.Create(configuration); var logger = silo.Logger; var orleansConfiguration = silo.CreateOrleansConfiguration(); var siloHost = new SiloHost(Environment.MachineName, orleansConfiguration); try { siloHost.DeploymentId = configuration.ClusterId; siloHost.InitializeOrleansSilo(); siloHost.StartOrleansSilo(false); logger.Information("Silo is started."); return(siloHost); } catch (Exception ex) { logger.Error(ex, "Failed to start silo."); siloHost.Dispose(); throw; } }
public void Dispose() { host.StopOrleansSilo(); host.Dispose(); AppDomain.Unload(domain); }
private static void ShutdownSilo() { if (siloHost != null) { siloHost.Dispose(); siloHost = null; } }
static void ShutdownSilo() { if (siloHost != null) { siloHost.Dispose(); GC.SuppressFinalize(siloHost); siloHost = null; } }
protected void Application_End(object sender, EventArgs e) { if (siloHost != null) { siloHost.Dispose(); GC.SuppressFinalize(siloHost); siloHost = null; } }
private static void ShutdownSilo() { if (null == _host) { return; } _host.StopOrleansSilo(); _host.Dispose(); _host = null; }
private static void ShutdownSilo() { if (_siloHost == null) { return; } _siloHost.Dispose(); GC.SuppressFinalize(_siloHost); _siloHost = null; }
public override void Dispose() { if (host == null) { return; } host.StopOrleansSilo(); host.UnInitializeOrleansSilo(); host.Dispose(); host = null; configurator.Dispose(); }
public static void GrainTestsClassCleanUp() { hostDomain.DoCallBack(() => { siloHost.Dispose(); siloHost = null; AppDomain.Unload(hostDomain); }); var startInfo = new ProcessStartInfo { FileName = "taskkill", Arguments = "/F /IM vstest.executionengine.x86.exe", UseShellExecute = false, WindowStyle = ProcessWindowStyle.Hidden, }; Process.Start(startInfo); }
public int Stop() { if (siloHost != null) { try { siloHost.StopOrleansSilo(); siloHost.Dispose(); Console.WriteLine($"Orleans silo '{siloHost.Name}' shutdown."); } catch (Exception exc) { siloHost.ReportStartupError(exc); Console.Error.WriteLine(exc); return(1); } } return(0); }
public bool Stop() { Console.WriteLine("Stopping SiloHost..."); try { _siloHost.StopOrleansSilo(); _siloHost.Dispose(); GC.SuppressFinalize(_siloHost); Console.WriteLine($"Orleans silo '{_siloHost.Name}' shutdown."); return(true); } catch (Exception exc) { _siloHost.ReportStartupError(exc); var msg = $"{exc.GetType().FullName}:\n{exc.Message}\n{exc.StackTrace}"; Console.WriteLine(msg); return(false); } }
/// <summary> /// Stop and dispose of running SiloHost /// </summary> /// <returns></returns> public int Stop() { if (_siloHost == null) { throw new OrleansException("There is no silo server running to stop"); } try { _siloHost.ShutdownOrleansSilo(); _siloHost.Dispose(); Console.WriteLine($"Successfully stopped silo server {_siloHost.Name}"); } catch (Exception ex) { Console.Error.WriteLine(ex); return(1); } return(0); }
protected virtual void Dispose(bool dispose) { siloHost.Dispose(); siloHost = null; }