BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Turnstone · Restart an interrupted chunked file job

Resume a chunked file job from acknowledged checkpoints.

Restart an interrupted chunked file job

A resumed batch can skip the final partial chunk when it treats a repeated acknowledgement as new progress. Ten bytes form three chunks of width four. The repeated checkpoint for chunk zero leaves the two-byte final chunk to process.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-turnstone.git
cd blyx-turnstone
blyxc native-run project.blyx -- 10 4 "0,0,1"

API and return values

Returns [next offset, byte count, remaining chunks, replayed checkpoints]. Offsets use half-open ranges. Invalid input returns an empty vector.

ArgumentAccepted input
sizenonnegative exact integer
widthpositive exact integer
checkpointsVector of: nonnegative exact integer

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
8
2
1
1
Open in the full playground →

Practice

Change checkpoints = [0, 1, 2]. Predict the result, then run the program.

Hint

Returns [next offset, byte count, remaining chunks, replayed checkpoints]. Offsets use half-open ranges.

Worked solution

The result vector is [10, 0, 0, 0]. Compare its fields with the return layout in the API section.

Find

    let checkpoints = [0, 0, 1];

Replace with

    let checkpoints = [0, 1, 2];

Output after the change

10
0
0
0