Per-ractor (or process) semaphore #392
nateberkopec
started this conversation in
Documentation
Replies: 1 comment 1 reply
|
If you're trying to enforce a concurrency limit in a non-homogeneous environment (e.g. multiple threads, Ractors, or processes), it's impossible to do so using an in-memory In environments like Falcon, where your app might run across multiple schedulers or even processes, any meaningful concurrency limit must be enforced using an external coordination mechanism—something that all units of concurrency can observe and respect. Examples include:
In short: |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
How do I ensure a limit of tasks on a per-process basis? Storing a Semaphore in a class variable or constant and then using MY_SEMAPHORE.async results in fibers being used across threads. e.g., for the url-fetch-in-parallel example, how do we ensure only 10 tasks are created in the current Ractor?
All reactions