Repository navigation
Conversation
Expose per-run JSON capabilities through Javex.Host.call on both backends. Keep HTTP, credentials and authorization in application callbacks while bounding callback calls, bytes and deadlines and cancelling pending work. Bundle the custom Javy provider with its source and build instructions, and cover HTTP, static/dynamic modules, errors, quotas and cancellation. Amp-Thread-ID: https://ampcode.com/threads/T-01a15077-f2fd-70be-bb87-b78853bd4c2c Co-authored-by: Pedro Piñera Buendía <pedro@pepicrft.me>
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.
What
Add per-execution Elixir callbacks callable synchronously from JavaScript through
Javex.Host.call(name, argument), on both the in-process and isolated backends. HTTP stays in application callbacks; Javex adds no HTTP dependency or guest networking.Callbacks receive
(argument, %{deadline: absolute_monotonic_ms})and return{:ok, json_value}or{:error, %{"code" => ..., "message" => ...}}. Declared errors are catchableHostErrors; host crashes are sanitized. Call-count, request/result byte limits and callback deadlines terminate execution and cannot be bypassed with JS try/catch. Pending callbacks stop on cancellation, caller death or runtime shutdown, without blocking the runtime GenServer or occupying dirty CPU schedulers while waiting.Provider compatibility
Bundle a custom Javy provider with its source, locked dependencies and build instructions. It preserves the synchronous Javy environment and adds a private, bounded Wasm hostcall bridge. Persisted dynamic modules compiled against the previous provider must be recompiled. Older static modules must be recompiled to use the new JS API. This is synchronous, not
fetchor a Promise event loop.The README includes an application-owned HTTP example with fixed destination, host-only credentials and bounded response reads. Elixir/HTTP allocations remain outside guest/process memory budgets; external effects cannot be rolled back.
Verification
Verified locally on Linux:
JAVEX_BUILD=1 mix test --cover: 55 tests passed; 91.53% coverage.cargo test --manifest-path native/javex_nif/Cargo.toml --release --locked: 5 native tests passed.macOS was not exercised locally. No release or deployment is included.