Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Queue ¶
func Queue(ctx context.Context, fn func(ctx context.Context)) (execute func(ctx context.Context) (done <-chan struct{}))
Queue is used for coalescing repeated executions of the same function (fn). it returns a non-blocking execute function to be called for every execution request. the execution function returns an optional done channel to await completion.
Guarantees: - If the first call to execute is yet to complete, the second will be executed right after the first completes. - If two calls are to be executed but yet to complete, any subsequent execution will be discarded. - Discarded executions complete upon completion of the second queue.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.