import { Ref } from "@effect/core/io/Ref/definition"; import { Deferred } from "@effect/core/io/Deferred/definition"; import { Effect } from "@effect/core/io/Effect/definition"; export declare const CyclicBarrierSym: unique symbol; export type CyclicBarrierSym = typeof CyclicBarrierSym; /** * A `CyclicBarrier` is a synchronization aid that allows a set of fibers to all * wait for each other to reach a common barrier point. * * `CyclicBarrier`s are useful in programs involving a fixed sized party of * fibers that must occasionally wait for each other. The barrier is called * cyclic because it can be re-used after the waiting fibers are released. * * A `CyclicBarrier` supports an optional action command that is run once per * barrier point, after the last fiber in the party arrives, but before any * fibers are released. This barrier action is useful for updating shared-state * before any of the parties continue. * * @tsplus type effect/core/concurrent/CyclicBarrier */ export interface CyclicBarrier extends CyclicBarrierInternal { } /** * @tsplus type effect/core/concurrent/CyclicBarrier.Ops */ export interface CyclicBarrierOps { readonly $: CyclicBarrierAspects; } export declare const CyclicBarrier: CyclicBarrierOps; /** * @tsplus type effect/core/concurrent/CyclicBarrier.Aspects */ export interface CyclicBarrierAspects { } export declare class CyclicBarrierInternal { readonly [CyclicBarrierSym]: CyclicBarrierSym; private _parties; private _waiting; private _lock; private _action; private _broken; constructor(parties: number, waiting: Ref, lock: Ref>, action: Effect, broken: Ref); /** * The number of parties required to trip this barrier. */ get parties(): number; /** * The number of parties currently waiting at the barrier. */ get waiting(): Effect; /** * Queries if this barrier is in a broken state. */ get isBroken(): Effect; /** * Resets the barrier to its initial state. Breaks any waiting party. */ get reset(): Effect; /** * Waits until all parties have invoked await on this barrier. Fails if the * barrier is broken. */ get await(): Effect; private get succeed(); private get fail(); private get break(); } //# sourceMappingURL=definition.d.ts.map