disable message pool by default
Some checks failed
sync / sync (push) Has been skipped
test / test (push) Successful in 4m47s
coverage / build (push) Failing after 18m8s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-05-18 18:58:53 +03:00
parent d0978fb314
commit 6d85d3ee41
3 changed files with 65 additions and 44 deletions

5
kgo.go
View File

@@ -478,11 +478,15 @@ func (b *Broker) fnSubscribe(ctx context.Context, topic string, handler interfac
}
}
var messagePool bool
var fatalOnError bool
if b.opts.Context != nil {
if v, ok := b.opts.Context.Value(fatalOnErrorKey{}).(bool); ok && v {
fatalOnError = v
}
if v, ok := b.opts.Context.Value(subscribeMessagePoolKey{}).(bool); ok && v {
messagePool = v
}
}
if options.Context != nil {
@@ -500,6 +504,7 @@ func (b *Broker) fnSubscribe(ctx context.Context, topic string, handler interfac
done: make(chan struct{}),
fatalOnError: fatalOnError,
connected: b.connected,
messagePool: messagePool,
}
kopts := append(b.kopts,