Legend:
Library
Module
Module type
Parameter
Class
Class type
Implements an async aware throttling rate limiter on top of Core.Limiter.
All forms of enqueue_exn and enqueue' below will raise if the requested job is not possible to run within the resource limitations given to the related create_exn.
If any enqueued job raises then the exception will be raised to the monitor in scope when enqueue_exn is called. Deferred jobs passed to enqueue' return Raised (in a deferred manner) instead.
Throttle, Sequencer, and Resource_throttle re-implement the functionality available in the core Async.Throttle module with the hope that these implementations can eventually supplant that code. It is helpful to use these modules in systems that can afford to do a bit more testing so that we can get feedback on the behavior of the new implementation. They are intended to be mostly drop-in replacements.
Implements a basic throttle meant to bound the number of jobs that can concurrently run. Additionally the ~burst_size and ~sustained_rate_per_sec arguments can be used to control how many jobs can be spawned in a burst, and how quickly jobs can be spawned over time. If these options are not given to create_exn they are unbounded.
A resource throttle holds a static list of n resources that are handed out in a round-robin fashion to up to n concurrent jobs. A resource given to create may be re-used many times in the lifetime of t but will never be used by more than one job at a time.