read only chan

This commit is contained in:
nquidox 2026-02-21 15:55:29 +03:00
parent 40d1d3dd29
commit c8a6a7f8fa

View file

@ -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)