Skip to content

Commit

Permalink
feat: consumer auto commit interval
Browse files Browse the repository at this point in the history
  • Loading branch information
daheige committed Sep 7, 2022
1 parent 467fc9a commit 888fbaf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion option.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Options struct {
// no data wait second
NoDataWaitSec int

// ConsumerAutoCommitInterval consumer auto commit interval
// ConsumerAutoCommitInterval consumer auto commit interval (default: 1s)
ConsumerAutoCommitInterval time.Duration

// Logger logger
Expand Down Expand Up @@ -127,6 +127,13 @@ func WithLogger(logger Logger) Option {
}
}

// WithConsumerAutoCommitInterval set consumer auto commit interval.
func WithConsumerAutoCommitInterval(interval time.Duration) Option {
return func(o *Options) {
o.ConsumerAutoCommitInterval = interval
}
}

// PubOption publish option
type PubOption func(p *PublishOptions)

Expand Down

0 comments on commit 888fbaf

Please sign in to comment.