@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 15 lines 714 Bytes
Raw
1 import type * as Effect from "effect/Effect";
2 import * as Semaphore from "effect/Semaphore";
3
4 /**
5 * Dataplex throttles control-plane writes per project per minute. With the
6 * whole suite running in one process, more than a few concurrent Dataplex
7 * lifecycles exhaust the quota and time out, so every Dataplex test holds
8 * one of these slots for its whole body. A test's timeout includes the time
9 * it waits for a slot, so Dataplex tests use generous (15 min) timeouts.
10 */
11 const slots = Semaphore.makeUnsafe(4);
12
13 /** Run a Dataplex test body while holding one API-quota slot. */
14 export const withDataplexSlot = <A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
15 slots.withPermits(1)(self);