Schedule redelivery after a lease expires
Redelivery before a worker's lease expires can duplicate work. Make retry time depend on both the lease and the attempt count. The eight-tick lease ends at tick 18. A four-tick backoff makes tick 22 the earliest eligible retry.
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-sandpiper.git
cd blyx-sandpiper
blyxc native-run project.blyx -- 10 8 19 2 16 1API and return values
Returns [ready, ticks to eligibility, retry delay]. Delay begins when the lease expires. The queue host owns acknowledgement and delivery. Invalid input returns an empty vector.
| Argument | Accepted input |
|---|---|
| issued | nonnegative exact integer |
| ttl | positive exact integer |
| now | nonnegative exact integer |
| base | positive exact integer |
| ceiling | positive exact integer |
| attempt | 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
Expected output
0 3 4
Practice
Change now = 22.0. Predict the result, then run the program.
Hint
Returns [ready, ticks to eligibility, retry delay]. Delay begins when the lease expires. The queue host owns acknowledgement and delivery.
Worked solution
The result vector is [1, 0, 4]. Compare its fields with the return layout in the API section.
Find
let now = 19.0;Replace with
let now = 22.0;Output after the change
1 0 4
