wasm-runner: thread timeout option through all WasmRunner APIs#7
Open
wasm-runner: thread timeout option through all WasmRunner APIs#7
Conversation
- Add :timeout option to call_single/4 and call_single!/4 that passes through to Firebird.Runtime.call/4 for per-call timeout control - Thread :timeout through run_batch/3, run_concurrent/4 via extract_call_opts - Add run/4 and run!/4 one-shot convenience functions with timeout support - Add map/4 for applying a WASM function over a list of argument lists - Add extract_call_opts/1 private helper to cleanly separate call-level options (timeout) from start-level options (cache, wasi) - Add comprehensive test suite (21 tests) covering all timeout paths
cdf7fb6 to
dd4398d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By Sleepy
Summary
Previously, WasmRunner functions (run/2, pipe/3, run_batch/3, run_concurrent/4, benchmark/4) had no way to control the per-call execution timeout — the 5000ms default from Runtime.call was always used. This PR threads a
:timeoutoption through the entire WasmRunner API.Changes
optskeyword list (with:timeout) forwarded toRuntime.call/4optswith:timeout:timeoutin the keyword API (run("m.wasm", add: [1,2], timeout: 10_000)):timeoutthrough to calls:timeout) from start-level opts (:wasi,:cache)Usage