options added
This commit is contained in:
parent
8b1bc57cd0
commit
3f0401de1d
5 changed files with 91 additions and 44 deletions
35
options.go
Normal file
35
options.go
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package rabbit
|
||||
|
||||
import "time"
|
||||
|
||||
type Option func(*options)
|
||||
|
||||
func WithReconnectDelay(t time.Duration) Option {
|
||||
return func(op *options) {
|
||||
op.reconnectDelay = t
|
||||
}
|
||||
}
|
||||
|
||||
func WithReInitDelay(t time.Duration) Option {
|
||||
return func(op *options) {
|
||||
op.reInitDelay = t
|
||||
}
|
||||
}
|
||||
|
||||
func WithResendDelay(t time.Duration) Option {
|
||||
return func(op *options) {
|
||||
op.resendDelay = t
|
||||
}
|
||||
}
|
||||
|
||||
func WithConsumerRateLimit(t time.Duration) Option {
|
||||
return func(op *options) {
|
||||
op.consumerRateLimit = t
|
||||
}
|
||||
}
|
||||
|
||||
func WithConsumerBurstSize(t int) Option {
|
||||
return func(op *options) {
|
||||
op.consumerBurstSize = t
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue