Comments (15)
I wouldn't be disappointed if we used mio.
from jstime.
I'd be interested in diving into this one - I'd definitely need more guidance, and will probably have to do a good chunk of research in order to complete it.
I found this project, which looks like it might be relevant for I/O (unless you want to stick to libuv bindings): https://github.com/tokio-rs/mio
from jstime.
@solumos I think that this will depend heavily on the type of system access we want to provide. @devsnek and I had talked about about maybe using libuv / uvwasi, although I am definitely flexible.
from jstime.
Thinking about this more, we should use something that has support for io_uring
from jstime.
It would be interesting to see if this can be abstracted enough so that a "bring your own event loop" solution can happen for lib usage. Or at least "bring your own futures executor".
A big io_uring
in general though. https://crates.io/crates/rio
from jstime.
It would be interesting to see if this can be abstracted enough so that a "bring your own event loop" solution can happen for lib usage. Or at least "bring your own futures executor".
That sounds pretty cool to me - in a sense, make the event loop "pluggable"?
we should use something that has support for io_uring
A big 👍 on
io_uring
in general though. https://crates.io/crates/rio
Sounds like we like io_uring
? Here's some relevant discussion in mio + libuv that I looked over for context.
It seems like we want to support a pluggable event loop such that:
- A cross-platform
epoll
/kqueue
/IOCP
abstraction is supported "out-of-the-box" (likely using mio?) - A linux-based
io_uring
abstraction is supported (likely using rio?). - Any "bring your own" event loop can be "plugged-in"
To that end, we could define our event loop abstraction as a trait
, and provide mio
+ rio
implementations that can be "plugged-in" to the runtime. Any valid implementation of the event loop trait could also be "plugged-in" via "jstime-as-lib".
What do y'all think? Does that make sense?
from jstime.
One thing to take into account is that the IO library won't necessarily be the only thing driving the event loop. Timers would be one example of this.
from jstime.
Ah - so maybe the proper pluggable abstraction in my description above is the io library, rather than the event loop? Does that make more sense?
from jstime.
@solumos the non-io stuff wouldn't be pluggable, i was just pointing out that the io library itself can't be the driver of the event loop, because there are other pieces.
from jstime.
The approach I had in mind was to to have a pluggable exectutor. That is, jstime
should be able to provide a Future
that can be used with any executor.
FWIW, I took a quick look, and it looks like this is exactly how Deno works.
from jstime.
This seems potentially useful (not a shameless plug, I swear!) https://github.com/DataDog/scipio
from jstime.
As a quick update given this has been sitting for a while - it's been really interesting digging into this, but due to some unforeseen personal circumstances, I won't be able to devote as much time to this issue (as well as the project at-large) as I'd hoped. If anyone else would like to pick this up, please feel free!
I do think the "pluggable Futures executor" is a really interesting concept for jstime, and it's been fun exploring. It seems to me the first step would be implementing the event loop with a pluggable futures executor, while also focusing on a single implementation to "plug in" as the default executor (plenty of options to choose from!)
from jstime.
I might want to dig into this, so some thoughts:
Pluggable: can we do it via a trait, and have one (some? none?) default implementation?
from jstime.
I think we need to hold off on exploring the event loop until we can fix TLA support and get the V8 update unblocked
from jstime.
AFAIAW, v8 has an abstraction of Platform, where you can plugin you event loop implementation, for example, node.js uses libuv, chrome uses libevent.
from jstime.
Related Issues (20)
- Broadening collaborators and creating open governance
- Support Top-Level Await HOT 2
- Support WHATWG Streams HOT 2
- Improve the docs HOT 2
- MacOS Binaries need to be notarized HOT 7
- Stack traces no longer working HOT 2
- Errors in run JavaScript code still have exit code of 0 HOT 1
- ESM Builtins
- store repl history between sessions HOT 1
- implement import.meta.url
- Implement WHATWG URL api HOT 2
- Implement HTML standard timer APIs HOT 5
- Should we implement NAPI? HOT 3
- Should we allow PRs with no review to land after a certain amount of time?
- Are web-compat builtins actually a goal? HOT 5
- jstime_core: Modularizing builtins
- Release action is busted HOT 1
- Compilation failure when installing via `cargo install jstime` HOT 5
- wasm modules
- json modules HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jstime.