5 ms·
Is rust ever going to re-introduce the N:M model again ? For services which need to handle 1M connections the system threads are too expensive and mio brings ba
by zimbatm 10y ago
Is rust ever going to re-introduce the N:M model again ? For services which need to handle 1M connections the system threads are too expensive and mio brings back the callback hell.
- lifthrasiir 10y agoHave you tried mioco [1]? It looks fine enough to avoid the callback hell. [1] https://github.com/dpc/mioco https://github.com/dpc/mioco
- zimbatm 10y agoThanks. So no clear winner yet. Does libraries have to be re-written to support the coroutines ?
- GolDDranks 10y agoMIO is a very low-level library (as it tries to be as zero-overhead as possible), and there's multiple nicer abstractions written on top of it. Check this: https://github.com/carllerche/mio#libraries https://github.com/carllerche/mio#libraries
- eddyb 10y agomio has nothing to do with callbacks in its design, unless you build such an abstraction yourself on top of it. However, without an ergonomic way to create state machines (i.e. generators), it's hard to use at all in the intended fashion (small per-connection state instead of large boxed closures or coroutine/thread stacks).
- Jweb_Guru 10y agoRust's M:N design was not going to scale to 1M connections, and it's hugely unlikely that you need 1M simultaneous connections.