Skip to content

Commit

Permalink
kgo: add AllowRebalance and CloseAllowingRebalance to GroupTransactSe…
Browse files Browse the repository at this point in the history
…ssion

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.
  • Loading branch information
twmb committed Jun 8, 2024
1 parent 40589af commit 4affe8e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/kgo/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down

0 comments on commit 4affe8e

Please sign in to comment.