Skip to content

Commit

Permalink
need to customized timeout in struct Options (#39)
Browse files Browse the repository at this point in the history
Co-authored-by: ken <[email protected]>
  • Loading branch information
ken0911208818 and ken0911208818 authored Dec 15, 2021
1 parent 7e8a2b6 commit fbd8614
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ func WithFn(fn func(context.Context, QueuedMessage) error) Option {
}
}

// WithTimeOut set custom timeout
func WithTimeOut(t time.Duration) Option {
return func(q *Options) {
q.timeout = t
}
}

type Options struct {
workerCount int
timeout time.Duration
Expand Down

0 comments on commit fbd8614

Please sign in to comment.