Non-blocked sockets programming in 0.16

My project is Single-Threaded Reactor

  • non-blocked sockets
  • all io on one thread
  • “pool” loop (epool, kqueue, wepoll)

It’s based on 0.15.2, just plain std.posix

All my design is based on assumption that io is on single thread.

How I can achieve this model in 0.16 (with or without Io)?

The non-blocking implementations Evented are only proof-of-concept quality rn, very WIP and I don’t think any non-blocking implementations support networking yet.

There is zio which provides a non-blocking implementation, however its 0.16 branch is 2 months without work, so it is almost certainly not compatible with the release.

You’ll have to do your own thing, which you could make an Io implementation if you want, but that may add an unreasonable amount of work on top of what you need. It’s up to you.

1 Like

so in short form an answer

No - you can not (with or without Io) :joy:

With Io: Currently no, in the future (pun intended) yes

without Io: depends, std may implement the api’s you need. Or it may not. regardless they will be lower level and platform specific.

i look at the Io implementation and remember C++ frameworks

looks as binary solution or Io or …

still i don’t understand the reason of tightly coupling api wrappers with Io framework