MCPcopy Create free account
hub / github.com/Effect-TS/effect / takeIfAvailable

Method takeIfAvailable

packages/effect/src/Semaphore.ts:143–143  ·  view source on GitHub ↗

* Acquires the specified number of permits only if they are immediately * available. * * **When to use** * * Use to manually acquire permits without waiting, paired with `release`.

(this: Semaphore, permits: number)

Source from the content-addressed store, hash-verified

141 * Use to manually acquire permits without waiting, paired with `release`.
142 */
143 takeIfAvailable(this: Semaphore, permits: number): Effect.Effect<boolean>
144
145 /**
146 * Releases the specified number of permits and returns the resulting

Callers 2

Semaphore.test.tsFile · 0.65
Semaphore.tsFile · 0.65

Implementers 1

SemaphoreImplpackages/effect/src/Semaphore.ts

Calls

no outgoing calls

Tested by

no test coverage detected