Queues a function to be run sometime in the future, assuming that the key is unique for the queue.
Queues a function to be run sometime in the future, assuming that the key is unique for the queue.
the key used to determine if the function is to be added
the function to run
None if the function was queued successfully, otherwise Some error message
The
AsyncUniqueFunctionQueueallows you to queue up a series of functions to run. The functions is run one at a time (sequentially) and will not block the current thread (asynchronously). Every function has an associated key which must be unique for the queue, or else the function can't be added.This is useful behavior when you expect several equivalent calls in a short time, and only want to process the first one.
type of the key to be used to check for equality