Skip to content

Commit e224e90

Browse files
committed
kgo: allow HookBrokerRead and HookBrokerE2E to both be called
1 parent 875761a commit e224e90

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎pkg/kgo/broker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,10 +1217,10 @@ func (cxn *brokerCxn) readResponse(
12171217
bytesRead, buf, readWait, timeToRead, readErr := cxn.readConn(ctx, timeout, readEnqueue)
12181218

12191219
cxn.cl.cfg.hooks.each(func(h Hook) {
1220-
switch h := h.(type) {
1221-
case HookBrokerRead:
1220+
if h, ok := h.(HookBrokerRead); ok {
12221221
h.OnBrokerRead(cxn.b.meta, key, bytesRead, readWait, timeToRead, readErr)
1223-
case HookBrokerE2E:
1222+
}
1223+
if h, ok := h.(HookBrokerE2E); ok {
12241224
h.OnBrokerE2E(cxn.b.meta, key, BrokerE2E{
12251225
BytesWritten: bytesWritten,
12261226
BytesRead: bytesRead,

0 commit comments

Comments
 (0)