MCPcopy
hub / github.com/Effect-TS/effect / withPermitsIfAvailable

Method withPermitsIfAvailable

packages/effect/src/Effect.ts:11802–11802  ·  view source on GitHub ↗

* Runs an effect only if the specified number of permits are immediately * available. * * **Details** * * This function attempts to acquire the specified number of permits. If they * are available, it runs the effect and releases the permits after the effect * completes. If perm

(permits: number)

Source from the content-addressed store, hash-verified

11800 * the result is `Option.none`.
11801 */
11802 withPermitsIfAvailable(permits: number): <A, E, R>(self: Effect<A, E, R>) => Effect<Option.Option<A>, E, R>
11803
11804 /**
11805 * Acquires the specified number of permits and returns the resulting

Callers 2

semaphore.test.tsFile · 0.80
PoolImplClass · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected