UNPKG

sflow

Version:

sflow is a powerful and highly-extensible library designed for processing and manipulating streams of data effortlessly. Inspired by the functional programming paradigm, it provides a rich set of utilities for transforming streams, including chunking, fil

27 lines 856 B
import type { Awaitable } from "./Awaitable"; /** * Assume Stream content is ordered plain json object, (class is not supported) * And new element always insert into head * * Set ttl in your store settings * * 1. cache whole list once upstream flushed * 2. Stop upstream and Continue with cached list once head matched * * This step should place at near the output end. */ export declare function cacheTails<T>(store: { has?: (key: string) => Awaitable<boolean>; get: (key: string) => Awaitable<T[] | undefined>; set: (key: string, chunks: T[]) => Awaitable<void>; }, _options?: string | { /** * Key could step name, * or defaults to `new Error().stack` if you r lazy enough */ key?: string; }): { writable: WritableStream<any>; readable: ReadableStream<any>; }; //# sourceMappingURL=cacheTails.d.ts.map