Create a new stream for a given context.
Typically a file path, but could be an arbitrary object.
A readable stream.
Get a cache key from a given Context. Useful when context object is rich
and not unique, but a sub-property of it (e.g. context.path
) uniquely
represents the cached value.
Typically a file path, but could be an arbitrary object.
An arbitrary string or object to be used as a key for an Map
Put managed stream into the storage.
Entry to be stored.
Context reference.
Remove managed stream from the storage. Called when managed stream gets destroyed.
Entry to be removed.
A context reference that was provided to put()
.
Take stored stream out of the storage (and remove it). The returned entry
MUST have an entry.offset
less or equal to startOffset
.
Ideally, it should be as close as possible to startOffset
.
Starting offset into the stream.
A context reference that was provided to put()
.
Stored entry or undefined
.
Interface for the storage required by
RangeFinder
.See
DefaultStorage for a default implementation.