import type * as Effect from "@effect/io/Effect"; import type * as Scope from "@effect/io/Scope"; import type * as STM from "@effect/stm/STM"; import type * as TQueue from "@effect/stm/TQueue"; /** * @since 1.0.0 * @category symbols */ export declare const THubTypeId: unique symbol; /** * @since 1.0.0 * @category symbols */ export type THubTypeId = typeof THubTypeId; /** * @since 1.0.0 * @category models */ export interface THub extends TQueue.TEnqueue { } /** * Waits until the hub is shutdown. The `STM` returned by this method will * not resume until the queue has been shutdown. If the hub is already * shutdown, the `STM` will resume right away. * * @since 1.0.0 * @category mutations */ export declare const awaitShutdown: (self: THub) => STM.STM; /** * Creates a bounded hub with the back pressure strategy. The hub will retain * messages until they have been taken by all subscribers, applying back * pressure to publishers if the hub is at capacity. * * @since 1.0.0 * @category constructors */ export declare const bounded: (requestedCapacity: number) => STM.STM>; /** * Returns the number of elements the hub can hold. * * @since 1.0.0 * @category getters */ export declare const capacity: (self: THub) => number; /** * Creates a bounded hub with the dropping strategy. The hub will drop new * messages if the hub is at capacity. * * @since 1.0.0 * @category constructors */ export declare const dropping: (requestedCapacity: number) => STM.STM>; /** * Returns `true` if the `THub` contains zero elements, `false` otherwise. * * @since 1.0.0 * @category getters */ export declare const isEmpty: (self: THub) => STM.STM; /** * Returns `true` if the `THub` contains at least one element, `false` * otherwise. * * @since 1.0.0 * @category getters */ export declare const isFull: (self: THub) => STM.STM; /** * Returns `true` if `shutdown` has been called, otherwise returns `false`. * * @since 1.0.0 * @category getters */ export declare const isShutdown: (self: THub) => STM.STM; /** * Publishes a message to the hub, returning whether the message was published * to the hub. * * @since 1.0.0 * @category mutations */ export declare const publish: { (value: A): (self: THub) => STM.STM; (self: THub, value: A): STM.STM; }; /** * Publishes all of the specified messages to the hub, returning whether they * were published to the hub. * * @since 1.0.0 * @category mutations */ export declare const publishAll: { (iterable: Iterable): (self: THub) => STM.STM; (self: THub, iterable: Iterable): STM.STM; }; /** * Retrieves the size of the hub, which is equal to the number of elements * in the hub. This may be negative if fibers are suspended waiting for * elements to be added to the hub. * * @since 1.0.0 * @category getters */ export declare const size: (self: THub) => STM.STM; /** * Creates a bounded hub with the sliding strategy. The hub will add new * messages and drop old messages if the hub is at capacity. * * For best performance use capacities that are powers of two. * * @since 1.0.0 * @category constructors */ export declare const sliding: (requestedCapacity: number) => STM.STM>; /** * Subscribes to receive messages from the hub. The resulting subscription can * be evaluated multiple times to take a message from the hub each time. The * caller is responsible for unsubscribing from the hub by shutting down the * queue. * * @since 1.0.0 * @category mutations */ export declare const subscribe: (self: THub) => STM.STM>; /** * Subscribes to receive messages from the hub. The resulting subscription can * be evaluated multiple times within the scope to take a message from the hub * each time. * * @since 1.0.0 * @category mutations */ export declare const subscribeScoped: (self: THub) => Effect.Effect>; /** * Creates an unbounded hub. * * @since 1.0.0 * @category constructors */ export declare const unbounded: () => STM.STM>; //# sourceMappingURL=THub.d.ts.map