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)