Example #1
0
 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"));
 }
Example #2
0
        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;
            }
        }
Example #3
0
            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));
            }
Example #4
0
 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;
     }
 }
Example #5
0
 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"));
 }