From 4affe8efe08cba635f416180d278b407140eb087 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Sat, 8 Jun 2024 17:22:19 -0600 Subject: [PATCH] kgo: add AllowRebalance and CloseAllowingRebalance to GroupTransactSession These two functions are basically required if you use the BlockRebalanceOnPoll function when initializing a GroupTransactSession, so, it seems worth it to promote these to direct APIs on GTS. Closes #753. --- pkg/kgo/txn.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/kgo/txn.go b/pkg/kgo/txn.go index 7df9c65e..9321e7f7 100644 --- a/pkg/kgo/txn.go +++ b/pkg/kgo/txn.go @@ -157,6 +157,18 @@ func (s *GroupTransactSession) Close() { s.cl.Close() } +// AllowRebalance is a wrapper around Client.AllowRebalance, with the exact +// same semantics. Refer to that function's documentation. +func (s *GroupTransactSession) AllowRebalance() { + s.cl.AllowRebalance() +} + +// CloseAllowingRebalance is a wrapper around Client.CloseAllowingRebalance, +// with the exact same semantics. Refer to that function's documentation. +func (s *GroupTransactSession) CloseAllowingRebalance() { + s.cl.CloseAllowingRebalance() +} + // PollFetches is a wrapper around Client.PollFetches, with the exact same // semantics. Refer to that function's documentation. //