This allows for operating a rate limiter entirely without having to spawn a background coordinating task.
It works by instead designating one of the waiting tasks as the core, making it responsible to wake up any waiting tasks as appropriate (including itself) once enough tokens are available. The core responsibility can then migrate between waiting tasks.
This allows for operating a rate limiter entirely without having to spawn a background coordinating task.
It works by instead designating one of the waiting tasks as the core, making it responsible to wake up any waiting tasks as appropriate (including itself) once enough tokens are available. The core responsibility can then migrate between waiting tasks.
Part of this implementation currently hits issues around the soundness of self-referential generators.
See the module level documentation for more information.