Expand description
Remote files downloaded to local ones, and stdin spooled to one. Reading and writing
are on separate threads (writing on the caller’s, never a runtime worker) with at most
QUEUED_CHUNKS between them, so a slow disk backs the transfer up instead of
memory. Store streams poll on the app’s runtime; blocking readers (HTTP, stdin) get
their own thread.
Structs§
- Temp
Download - A downloaded file, removed from disk when its last holder drops it: the app keeps one to read the file again, the dataset scanning it keeps another, and an event carrying one that is never handled removes it as it drops.
Enums§
- Stream
Error - Why a download did not arrive whole.
Constants§
- QUEUED_
CHUNKS - Chunks queued between the side reading a download and the thread writing it.
Functions§
- read_
into - Run
openon its own thread and pass each chunk towritehere, in order, returning the bytes written (a stated length must match). Reads run at mostQUEUED_CHUNKSahead; a silent server holds the reader, not this thread, withstopchecked between chunks and everySTALL_CHECK. The reader ends at its next chunk once this side goes. - stream_
into - Run
openonruntimeand pass each stream chunk towriteon this thread, in order, returning the bytes written.stop(and whether this side still listens) is checked between chunks and everySTALL_CHECKof silence. Errors, never a short success, on open or chunk failure, a refused write, a stop, or runtime shutdown. Blocks: never call on a runtime worker.
Type Aliases§
- Opened
- What opening a download answers: its stream or reader and its length, when the source gave one, or why it could not be opened.