WithWaiterContext 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)
| 21 | // will not change any results for adding data (Set()). Default is |
| 22 | // context.Background(). |
| 23 | func WithWaiterContext(ctx context.Context) WaiterConfigOption { |
| 24 | return func(c *Waiter) { |
| 25 | c.ctx = ctx |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | // NewWaiter returns a new Waiter that wraps the given diode. |
| 30 | func NewWaiter(d Diode, opts ...WaiterConfigOption) *Waiter { |