@@ -197,22 +197,20 @@ type Config struct {
197
197
// (MaxProcessingTime * ChanneBufferSize). Defaults to 100ms.
198
198
MaxProcessingTime time.Duration
199
199
200
- // The time interval between ticks of the fast checker. A value of 0
201
- // turns off the fast checker.
202
- // If this is set to a non-zero value, then there will be periodic
203
- // checks to see if messages have been written to the Messages channel.
204
- // If a message has not been written to the Messages channel since the
205
- // last tick of the fast checker, then the timer will be set.
200
+ // Whether or not to use the fast checker. The fast checker uses a
201
+ // ticker instead of a timer to implement the timeout functionality in
202
+ // (*partitionConsumer).responseFeeder.
203
+ // If a message is not written to the Messages channel between two ticks
204
+ // of the fast checker then a timeout is detected.
206
205
// Using the fast checker should typically result in many fewer calls to
207
206
// Timer functions resulting in a significant performance improvement if
208
207
// many messages are being sent and timeouts are infrequent.
209
208
// The disadvantage of using the fast checker is that timeouts will be
210
209
// less accurate. That is, the effective timeout could be between
211
- // `MaxProcessingTime` and `MaxProcessingTime + FastCheckerInterval`.
212
- // For example, if `MaxProcessingTime` is 100ms and
213
- // `FastCheckerInterval` is 10ms, then a delay of 108ms between two
210
+ // `MaxProcessingTime` and `2 * MaxProcessingTime`. For example, if
211
+ // `MaxProcessingTime` is 100ms then a delay of 180ms between two
214
212
// messages being sent may not be recognized as a timeout.
215
- FastCheckerInterval time. Duration
213
+ UseFastChecker bool
216
214
217
215
// Return specifies what channels will be populated. If they are set to true,
218
216
// you must read from them to prevent deadlock.
@@ -294,7 +292,7 @@ func NewConfig() *Config {
294
292
c .Consumer .Retry .Backoff = 2 * time .Second
295
293
c .Consumer .MaxWaitTime = 250 * time .Millisecond
296
294
c .Consumer .MaxProcessingTime = 100 * time .Millisecond
297
- c .Consumer .FastCheckerInterval = 0
295
+ c .Consumer .UseFastChecker = false
298
296
c .Consumer .Return .Errors = false
299
297
c .Consumer .Offsets .CommitInterval = 1 * time .Second
300
298
c .Consumer .Offsets .Initial = OffsetNewest
@@ -420,8 +418,6 @@ func (c *Config) Validate() error {
420
418
return ConfigurationError ("Consumer.MaxWaitTime must be >= 1ms" )
421
419
case c .Consumer .MaxProcessingTime <= 0 :
422
420
return ConfigurationError ("Consumer.MaxProcessingTime must be > 0" )
423
- case c .Consumer .FastCheckerInterval < 0 :
424
- return ConfigurationError ("Consumer.FastCheckerInterval must be >= 0" )
425
421
case c .Consumer .Retry .Backoff < 0 :
426
422
return ConfigurationError ("Consumer.Retry.Backoff must be >= 0" )
427
423
case c .Consumer .Offsets .CommitInterval <= 0 :
0 commit comments