Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-09-15 18:30:07 +03:00
parent 9ff61bdb1b
commit c89df95fdc
6 changed files with 241 additions and 132 deletions

View File

@@ -54,3 +54,12 @@ type commitIntervalKey struct{}
func CommitInterval(td time.Duration) broker.Option {
return broker.SetOption(commitIntervalKey{}, td)
}
var DefaultSubscribeMaxInflight = 1000
type subscribeMaxInflightKey struct{}
// SubscribeMaxInFlight specifies interval to send commits
func SubscribeMaxInFlight(n int) broker.SubscribeOption {
return broker.SetSubscribeOption(subscribeMaxInflightKey{}, n)
}