Package: effect
Module: Semaphore
Acquires the specified number of permits and returns the acquired permit count.
When to use
Use when you need manual permit acquisition for a lower-level protocol with explicit acquisition and release control.
Details
The effect waits until enough permits are available.
See
withPermit for automatically acquiring and releasing one permit around an effectwithPermits for automatically acquiring and releasing multiple permits around an effectrelease for returning manually acquired permitsSignature
declare const take: { (permits: number): (self: Semaphore) => Effect.Effect<number>; (self: Semaphore, permits: number): Effect.Effect<number>; }
Since v4.0.0