read only chan
This commit is contained in:
parent
40d1d3dd29
commit
c8a6a7f8fa
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue