- Notifications
You must be signed in to change notification settings - Fork 491
Open
Description
There is no way to return an error once a connection is established.
func (r *Resolver) OnMessage(ctx context.Context, args struct { ChatID string }) (chan *MessageResolver, error) { ch := make(chan *MessageResolver) msgCh, errCh := r.Service.Subscribe(args.ChatID) go func() { defer close(ch) for { select{ case <-ctx.Done(): return case <-errCh: // TODO: how to send error back to client return case msg, ok := <-msgCh: if !ok { return } ch <- &MessageResolver{ Message: msg, } } } }() return ch, nil } Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels