WithPollingContext sets the context to cancel any retrieval (Next()). It will not change any results for adding data (Set()). Default is context.Background().
(ctx context.Context)
| 33 | // will not change any results for adding data (Set()). Default is |
| 34 | // context.Background(). |
| 35 | func WithPollingContext(ctx context.Context) PollerConfigOption { |
| 36 | return func(c *Poller) { |
| 37 | c.ctx = ctx |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | // NewPoller returns a new Poller that wraps the given diode. |
| 42 | func NewPoller(d Diode, opts ...PollerConfigOption) *Poller { |