From c8a6a7f8fae6fbeec811b7f846578fa8864f887c Mon Sep 17 00:00:00 2001 From: nquidox Date: Sat, 21 Feb 2026 15:55:29 +0300 Subject: [PATCH] read only chan --- consumer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consumer.go b/consumer.go index 20c1317..22dde93 100644 --- a/consumer.go +++ b/consumer.go @@ -9,14 +9,14 @@ import ( ) type Consumer interface { - Start(ctx context.Context, chanLen uint) chan []byte + Start(ctx context.Context, chanLen uint) <-chan []byte } type consumeHandler struct { client *Client } -func (c *consumeHandler) Start(ctx context.Context, chanLen uint) chan []byte { +func (c *consumeHandler) Start(ctx context.Context, chanLen uint) <-chan []byte { msgCh := make(chan []byte, chanLen) go runConsumer(ctx, c.client, msgCh)