public void Dispose() { if (_bus != null) { _bus.Dispose(); _bus = null; } }
public bool Stop() { if (bus != null) { bus.Dispose(); } return(true); }
void OnCriticalError(string errorMessage, Exception exception) { // If you want the process to be active, dispose the bus. // Note that when the bus is disposed sending messages will throw with an ObjectDisposedException. bus.Dispose(); // If you want to kill the process, raise a fail fast error as shown below. //string failMessage = string.Format("Critical error shutting down:'{0}'.", errorMessage); //Environment.FailFast(failMessage, exception); }
void OnCriticalError(string errorMessage, Exception exception) { // To leave the process active, dispose the bus. // When the bus is disposed sending messages will throw an ObjectDisposedException. bus.Dispose(); // To kill the process, raise a fail fast error as shown below. // var failMessage = $"Critical error shutting down:'{errorMessage}'."; // Environment.FailFast(failMessage, exception); }
void OnCriticalError() { //Write log entry in version 3 since this is not done by default. Logger.Fatal("CRITICAL Error"); // If you want the process to be active, dispose the bus. // Note that when the bus is disposed sending messages will throw with an ObjectDisposedException. bus.Dispose(); // If you want to kill the process, raise a fail fast error as shown below. //string failMessage = string.Format("Critical error shutting down:'{0}'.", errorMessage); //Environment.FailFast(failMessage, exception); }
void OnCriticalError(string errorMessage, Exception exception) { try { // To leave the process active, dispose the bus. // When the bus is disposed, the attempt to send message will cause an ObjectDisposedException. bus.Dispose(); // Perform custom actions here, e.g. // NLog.LogManager.Shutdown(); } finally { var failMessage = $"Critical error shutting down:'{errorMessage}'."; Environment.FailFast(failMessage, exception); } }
private void Dispose(bool destruct) { if (!_disposed) { if (_bus != null) { _bus.Dispose(); _bus = null; } if (_factory != null) { _factory.Dispose(); _factory = null; } _disposed = true; } }
protected void Application_End() { startableBus.Dispose(); }
public void Stop() { bus.Dispose(); }
public void Dispose() { startableBus.Dispose(); }