Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to an async Rust runtime #394

Open
tessi opened this issue Jan 8, 2023 · 0 comments
Open

Switch to an async Rust runtime #394

tessi opened this issue Jan 8, 2023 · 0 comments

Comments

@tessi
Copy link
Owner

tessi commented Jan 8, 2023

While discussing #391 we found it's a good idea to switch Wasmex to an async Rust runtime, probably https://tokio.rs/.

An async runtime allows us to enable async wasmtime features, like

To achieve this, we must spawn tokio tasks for WASM function executions instead of spawning OS threads as we do now. We must also investigate whether we have other blocking code (looking at you, module compilation 👀 ) which must be migrated to work async to not block the event loop.

Generally, a high-level goal of this task is to be able to handle ~10k concurrent calls into WASM. A side-goal is to enable preemtive WASM scheduling (e.g. by utilizing epoch based interruptions) - we might want to implement preemtive scheduling in a follow-up issue, though, if it turns out to be too much for one change.

We might "borrow" some ideas from https://github.com/scrogson/franz (thanks @scrogson 🌻 ) and ideas from this rustler issue on how to implement async NIFs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant