Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Treatment upload

work/run::upload


Configuration

⬡ api: work/run::RunApi

Parameters

↳ var parallel: u32 = 4

Inputs

⇥ data: Stream<byte>
⇥ purpose: Block<Json> (json::Json)
⇥ whole: Block<void>

Outputs

↦ answer: Block<Json> (json::Json)
↦ completed: Block<void>
↦ error: Block<string>
↦ failed: Block<void>
↦ finished: Block<void>


Upload data to api.melodium.tech through an upload session of the run.

A session is opened for purpose, such as {"cache": {"name": "cargo"}}, then the bytes received through data are uploaded in parts while they come (http/upload::cut), at most parallel parts at once, each presigned by api.melodium.tech and retried after cuts. Memory holds about parallel parts, whatever the size of the data.

whole tells that data is all there is to upload, such as once what produces it completed. The session is then completed with the SHA-256 and the size of the data, and answer gives what the upload became, with completed. If data ends without whole, a part cannot be uploaded, or api.melodium.tech refuses the session, it is aborted, leaving nothing in storage, then failed is emitted and error gives the reason. finished is emitted in every case.

Presigned addresses never appear in logs, errors or outputs.