Closed kraftp closed 1 month ago
First comment - can we make it milliseconds?
First comment - can we make it milliseconds?
I switched the type to float--that way it's consistent with other Python duration APIs like sleep or DBOS.sleep that expect a time in seconds but allow subsecond precision.
You can now pass in a "limiter" to a queue, for example:
The queue will start at most
max
tasks in any givenduration
seconds. This is useful when submitting jobs to rate-limited APIs. For example, if your API only accepts 100 requests per minute, set amax
of 100 and aduration
of 60.