Configuration class for the sNTP client
Inheritance: DotNetWorkQueue.Configuration.BaseTimeConfiguration
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueTransportOptions"/> class.
        /// </summary>
        /// <param name="sntpTimeConfiguration">The SNTP time configuration.</param>
        /// <param name="delayedProcessingConfiguration">The delayed processing configuration.</param>
        public RedisQueueTransportOptions(SntpTimeConfiguration sntpTimeConfiguration, 
            DelayedProcessingConfiguration delayedProcessingConfiguration)
        {
            Guard.NotNull(() => sntpTimeConfiguration, sntpTimeConfiguration);
            Guard.NotNull(() => delayedProcessingConfiguration, delayedProcessingConfiguration);

            _clearExpiredMessagesBatchLimit = 50;
            _moveDelayedMessagesBatchLimit = 50;
            _resetHeartBeatBatchLimit = 50;
            DelayedProcessingConfiguration = delayedProcessingConfiguration;
            SntpTimeConfiguration = sntpTimeConfiguration;
        }
        public void Create()
        {
            var test = new SntpTimeConfiguration();
            Assert.Equal(TimeSpan.FromSeconds(900), test.RefreshTime);
            Assert.Equal(123, test.Port);
            Assert.Equal("pool.ntp.org", test.Server);

            test.RefreshTime = TimeSpan.FromSeconds(100);
            Assert.Equal(TimeSpan.FromSeconds(100), test.RefreshTime);

            test.Port = 567;
            Assert.Equal(567, test.Port);

            test.Server = "test";
            Assert.Equal("test", test.Server);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SntpUnixTime" /> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="configuration">The configuration.</param>
 public SntpUnixTime(ILogFactory log, SntpTimeConfiguration configuration)
     : base(log, configuration)
 {
     _configuration = configuration;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SntpUnixTime" /> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="configuration">The configuration.</param>
 public SntpUnixTime(ILogFactory log, SntpTimeConfiguration configuration)
     : base(log, configuration)
 {
     _configuration = configuration;
 }