Closed matthewtsmith closed 5 years ago
Context.Done() is not being obeyed when processAll = false
Given the following example, the subscriber will not break out of the processEvent loop if either the timeout is passed or cancelFunc() is called
timeout
cancelFunc()
ctx, cancelFunc := context.WithTimeout(context.Background(), timeout) events := subscriber.SubscribeToExchange(ctx, string(eventType), Event{}, amqp.Consumer{}) for e := range events { eventData := e.Data.(*Event) if filter == nil || filter(eventData) { e.Done() return eventData, nil } e.Done() }
Thank you
@vetcher Thanks for the quick release.
Context.Done() is not being obeyed when processAll = false
Given the following example, the subscriber will not break out of the processEvent loop if either the
timeout
is passed orcancelFunc()
is called