@flowscripter/pluggable-io-framework
    Preparing search index...

    Function locallyCached

    • Wraps a StreamHandle factory (e.g. () => provider.getReadableStream(path)) so the underlying source is read at most once - the first call drains the source while caching every chunk in memory; every subsequent call replays the cached chunks without touching the source again.

      A plain StreamHandle only exposes a single one-shot ReadableStream, so caching can't be a StreamDecorator<K, C> operating on an already-open handle (there would be nothing left to re-read on a second call) - it has to intercept the open operation itself, provider-agnostic regardless of what kind of source is behind it.

      Type Parameters

      • K extends ChunkKind

      Parameters

      • open: () => Promise<StreamHandle<K>>

      Returns () => Promise<StreamHandle<K>>