#semaphore Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
TypeScript Concurrency Limiter (semaphore)
Run an array of async tasks but limit concurrency to N at a time — like p-limit, in 30 lines. Preserves input order in the output array.
Java Semaphore — Bounded Concurrency
Limit how many threads can enter a critical section. `acquire()` blocks until a permit is available; `release()` returns one. Use for rate limits, connection pools, or any "max N at a time" pattern.
Python asyncio Concurrency Limiter (Semaphore)
Run hundreds of coroutines but cap how many are in-flight at any moment. asyncio.Semaphore inside the task body is the cleanest way to "do at most 10 of these at a time."
Go Concurrency Limit via Buffered Channel (Semaphore)
A buffered channel of size N is the simplest semaphore in Go — acquire by sending, release by receiving. Zero dependencies, no sync.Semaphore needed.
Rust Concurrency Limit with Semaphore
Fan out N tasks but limit how many run at once via `tokio::sync::Semaphore`. Standard pattern for HTTP fan-out where you must respect a server's rate limit.