import * as O from "../../Option"; import * as T from "./_internal/task"; import { XQueue } from "./model"; /** * Takes between min and max number of values from the queue. If there * is less than min items available, it'll block until the items are * collected. */ export declare const takeBetween: ( min: number, max: number ) => (self: XQueue) => T.Task; /** * Takes between min and max number of values from the queue. If there * is less than min items available, it'll block until the items are * collected. */ export declare const takeBetween_: ( self: XQueue, min: number, max: number ) => T.Task; /** * Waits until the queue is shutdown. * The `IO` returned by this method will not resume until the queue has been shutdown. * If the queue is already shutdown, the `IO` will resume right away. */ export declare const awaitShutdown: (self: XQueue) => T.IO; /** * How many elements can hold in the queue */ export declare const capacity: (self: XQueue) => number; /** * `true` if `shutdown` has been called. */ export declare const isShutdown: (self: XQueue) => T.IO; /** * Places one value in the queue. */ export declare const offer: ( a: A ) => (self: XQueue) => T.Task; /** * Places one value in the queue. */ export declare const offer_: ( self: XQueue, a: A ) => T.Task; /** * For Bounded Queue: uses the `BackPressure` Strategy, places the values in the queue and always returns true. * If the queue has reached capacity, then * the fiber performing the `offerAll` will be suspended until there is room in * the queue. * * For Unbounded Queue: * Places all values in the queue and returns true. * * For Sliding Queue: uses `Sliding` Strategy * If there is room in the queue, it places the values otherwise it removes the old elements and * enqueues the new ones. Always returns true. * * For Dropping Queue: uses `Dropping` Strategy, * It places the values in the queue but if there is no room it will not enqueue them and return false. * */ export declare const offerAll: ( as: Iterable ) => (self: XQueue) => T.Task; /** * For Bounded Queue: uses the `BackPressure` Strategy, places the values in the queue and always returns true. * If the queue has reached capacity, then * the fiber performing the `offerAll` will be suspended until there is room in * the queue. * * For Unbounded Queue: * Places all values in the queue and returns true. * * For Sliding Queue: uses `Sliding` Strategy * If there is room in the queue, it places the values otherwise it removes the old elements and * enqueues the new ones. Always returns true. * * For Dropping Queue: uses `Dropping` Strategy, * It places the values in the queue but if there is no room it will not enqueue them and return false. * */ export declare const offerAll_: ( self: XQueue, as: Iterable ) => T.Task; /** * Interrupts any fibers that are suspended on `offer` or `take`. * Future calls to `offer*` and `take*` will be interrupted immediately. */ export declare const shutdown: (self: XQueue) => T.IO; /** * Retrieves the size of the queue, which is equal to the number of elements * in the queue. This may be negative if fibers are suspended waiting for * elements to be added to the queue. */ export declare const size: (self: XQueue) => T.IO; /** * Removes the oldest value in the queue. If the queue is empty, this will * return a computation that resumes when an item has been added to the queue. */ export declare const take: (self: XQueue) => T.Task; /** * Removes all the values in the queue and returns the list of the values. If the queue * is empty returns empty list. */ export declare const takeAll: ( self: XQueue ) => T.Task; /** * Takes up to max number of values in the queue. */ export declare const takeAllUpTo: ( n: number ) => (self: XQueue) => T.Task; /** * Takes up to max number of values in the queue. */ export declare const takeAllUpTo_: ( self: XQueue, n: number ) => T.Task; /** * Creates a new queue from this queue and another. Offering to the composite queue * will broadcast the elements to both queues; taking from the composite queue * will dequeue elements from both queues and apply the function point-wise. * * Note that using queues with different strategies may result in surprising behavior. * For example, a dropping queue and a bounded queue composed together may apply `f` * to different elements. */ export declare const mapBothM: ( that: XQueue, f: (b: B, c: C) => T.Task ) => ( self: XQueue ) => XQueue; /** * Creates a new queue from this queue and another. Offering to the composite queue * will broadcast the elements to both queues; taking from the composite queue * will dequeue elements from both queues and apply the function point-wise. * * Note that using queues with different strategies may result in surprising behavior. * For example, a dropping queue and a bounded queue composed together may apply `f` * to different elements. */ export declare const mapBothM_: ( self: XQueue, that: XQueue, f: (b: B, c: C) => T.Task ) => XQueue; /** * Like `bothWithM`, but uses a pure function. */ export declare const mapBoth: ( that: XQueue, f: (b: B, c: C) => D ) => (self: XQueue) => XQueue; /** * Like `bothWithM`, but uses a pure function. */ export declare const mapBoth_: ( self: XQueue, that: XQueue, f: (b: B, c: C) => D ) => XQueue; /** * Like `bothWith`, but tuples the elements instead of applying a function. */ export declare const both: ( that: XQueue ) => ( self: XQueue ) => XQueue; /** * Like `bothWith`, but tuples the elements instead of applying a function. */ export declare const both_: ( self: XQueue, that: XQueue ) => XQueue; /** * Transforms elements enqueued into and dequeued from this queue with the * specified effectual functions. */ export declare const bimap: ( f: (c: C) => A, g: (b: B) => D ) => (self: XQueue) => XQueue; /** * Transforms elements enqueued into and dequeued from this queue with the * specified effectual functions. */ export declare const bimap_: ( self: XQueue, f: (c: C) => A, g: (b: B) => D ) => XQueue; /** * Transforms elements enqueued into and dequeued from this queue with the * specified effectual functions. */ export declare const bimapM: ( f: (c: C) => T.Task, g: (b: B) => T.Task ) => (self: XQueue) => XQueue; /** * Transforms elements enqueued into and dequeued from this queue with the * specified effectual functions. */ export declare const bimapM_: ( self: XQueue, f: (c: C) => T.Task, g: (b: B) => T.Task ) => XQueue; /** * Transforms elements enqueued into this queue with a taskful function. */ export declare const contramapM: ( f: (c: C) => T.Task ) => (self: XQueue) => XQueue; /** * Transforms elements enqueued into this queue with a pure function. */ export declare const contramap: ( f: (c: C) => A ) => (self: XQueue) => XQueue; /** * Like `filterInput`, but uses a taskful function to filter the elements. */ export declare const filterInputM: ( f: (_: A1) => T.Task ) => (self: XQueue) => XQueue; /** * Like `filterInput`, but uses a taskful function to filter the elements. */ export declare const filterInputM_: ( self: XQueue, f: (_: A1) => T.Task ) => XQueue; /** * Applies a filter to elements enqueued into this queue. Elements that do not * pass the filter will be immediately dropped. */ export declare const filterInput: ( f: (_: A1) => boolean ) => (self: XQueue) => XQueue; /** * Applies a filter to elements enqueued into this queue. Elements that do not * pass the filter will be immediately dropped. */ export declare const filterInput_: ( self: XQueue, f: (_: A1) => boolean ) => XQueue; /** * Transforms elements dequeued from this queue with a taskful function. */ export declare const mapM: ( f: (b: B) => T.Task ) => (self: XQueue) => XQueue; /** * Transforms elements dequeued from this queue with a taskful function. */ export declare const mapM_: ( self: XQueue, f: (b: B) => T.Task ) => XQueue; /** * Take the head option of values in the queue. */ export declare const poll: (self: XQueue) => T.Task>; //# sourceMappingURL=combinators.d.ts.map