public MessageDispatcherInterceptorConfigurator(Config config, IDispatcherPrerequisites prerequisites) : base(config, prerequisites) { _instance = new MessageDispatcherInterceptor(this, config.GetString("id"), config.GetInt("throughput"), config.GetTimeSpan("throughput-deadline-time").Ticks, ConfigureExecutor(), Config.GetTimeSpan("shutdown-timeout")); }
protected void AssertDispatcher(MessageDispatcherInterceptor dispatcher, long stops) { var deadline = MonotonicClock.GetMilliseconds() + (long)(dispatcher.ShutdownTimeout.TotalMilliseconds * 5); try { Await(deadline, () => stops == dispatcher.Stops.Current); } catch (Exception ex) { Sys.EventStream.Publish(new Error(ex, dispatcher.ToString(), dispatcher.GetType(), $"actual: stops={dispatcher.Stops.Current}, required: stops={stops}")); throw; } }
public MessageDispatcherInterceptorConfigurator(Config config, IDispatcherPrerequisites prerequisites) : base(config, prerequisites) { if (config.IsNullOrEmpty()) { throw ConfigurationException.NullOrEmptyConfig <MessageDispatcherInterceptorConfigurator>(); } _instance = new MessageDispatcherInterceptor(this, config.GetString("id", null), config.GetInt("throughput", 0), config.GetTimeSpan("throughput-deadline-time", null).Ticks, ConfigureExecutor(), Config.GetTimeSpan("shutdown-timeout", null)); }
protected void AssertDispatcher(MessageDispatcherInterceptor dispatcher, long stops) { var deadline = MonotonicClock.GetMilliseconds() + (long)(dispatcher.ShutdownTimeout.TotalMilliseconds * 5); try { Await(deadline, () => stops == dispatcher.Stops.Current); } catch (Exception ex) { Sys.EventStream.Publish(new Error(ex, dispatcher.ToString(), dispatcher.GetType(), $"actual: stops={dispatcher.Stops.Current}, required: stops={stops}")); throw; } }
public MessageDispatcherInterceptorConfigurator(Config config, IDispatcherPrerequisites prerequisites) : base(config, prerequisites) { _instance = new MessageDispatcherInterceptor(this, config.GetString("id"), config.GetInt("throughput"), config.GetTimeSpan("thoughput-deadline-time").Ticks, ConfigureExecutor(), Config.GetTimeSpan("shutdown-timeout")); }