add ExposeLag option, to be able to disable lag exporting
Some checks failed
coverage / build (push) Successful in 4m20s
test / test (push) Failing after 16m7s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-10-09 23:20:10 +03:00
parent c4f8de4aca
commit ffd10d7ea9
5 changed files with 100 additions and 59 deletions

View File

@@ -14,7 +14,7 @@ var (
DefaultCommitInterval = 5 * time.Second
// DefaultStatsInterval specifies how fast check consumer lag
DefaultStatsInterval = 5 * time.Second
DefaultStatsInterval = 30 * time.Second
// DefaultSubscribeMaxInflight specifies how much messages keep inflight
DefaultSubscribeMaxInflight = 100
@@ -116,3 +116,10 @@ type subscribeMessagePoolKey struct{}
func SubscribeMessagePool(b bool) broker.SubscribeOption {
return broker.SetSubscribeOption(subscribeMessagePoolKey{}, b)
}
type exposeLagKey struct{}
// ExposeLag enabled subscriber lag via [meter.Meter]
func ExposeLag(b bool) broker.Option {
return broker.SetOption(exposeLagKey{}, b)
}