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

Method withPermitsIfAvailable

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

* Runs an effect only if the specified number of permits are immediately * available. * * **When to use** * * Use when guarded work should run only if the requested permits are * immediately available. * * **Details** * * This function attempts to acquire the specified

(
    this: Semaphore,
    permits: number
  )

Source from the content-addressed store, hash-verified

115 * the result is `Option.none`.
116 */
117 withPermitsIfAvailable(
118 this: Semaphore,
119 permits: number
120 ): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<Option.Option<A>, E, R>

Callers 5

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

Implementers 1

SemaphoreImplpackages/effect/src/Semaphore.ts

Calls

no outgoing calls

Tested by

no test coverage detected