Skip to content

Commit

Permalink
make some configs can be set for push_consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
dengzhiwen1 authored and cserwen committed Aug 4, 2022
1 parent 475234f commit ab5e3cf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions consumer/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,30 @@ func WithConsumeConcurrentlyMaxSpan(consumeConcurrentlyMaxSpan int) Option {
}
}

func WithPullThresholdForQueue(pullThresholdForQueue int64) Option {
return func(options *consumerOptions) {
options.PullThresholdForQueue = pullThresholdForQueue
}
}

func WithPullThresholdSizeForQueue(pullThresholdSizeForQueue int) Option {
return func(options *consumerOptions) {
options.PullThresholdSizeForQueue = pullThresholdSizeForQueue
}
}

func WithPullThresholdForTopic(pullThresholdForTopic int) Option {
return func(options *consumerOptions) {
options.PullThresholdForTopic = pullThresholdForTopic
}
}

func WithPullThresholdSizeForTopic(pullThresholdSizeForTopic int) Option {
return func(options *consumerOptions) {
options.PullThresholdSizeForTopic = pullThresholdSizeForTopic
}
}

// WithChainConsumerInterceptor returns a ConsumerOption that specifies the chained interceptor for consumer.
// The first interceptor will be the outer most, while the last interceptor will be the inner most wrapper
// around the real call.
Expand Down

0 comments on commit ab5e3cf

Please sign in to comment.