TrySchedule tries to schedule the provided callback function f to be executed in the order it was added. This is a best-effort operation. If the context passed to NewCallbackSerializer was canceled before this method is called, the callback will not be scheduled. Callbacks are expected to honor the
(f func(ctx context.Context))
| 61 | // Callbacks are expected to honor the context when performing any blocking |
| 62 | // operations, and should return early when the context is canceled. |
| 63 | func (cs *CallbackSerializer) TrySchedule(f func(ctx context.Context)) { |
| 64 | cs.callbacks.Put(f) |
| 65 | } |
| 66 | |
| 67 | // ScheduleOr schedules the provided callback function f to be executed in the |
| 68 | // order it was added. If the context passed to NewCallbackSerializer has been |