Cross platform IO engine and a general purpose timer for Nim. https://github.com/xflywind/ioselectors
Enhancements for selectors module in stdlib and add wepoll supports in windows. Timer is based on Timerwheel. With minor changes, this timer can easily replace the heap timer in asyncdispatch: https://github.com/xflywind/ioselectors/blob/0603265f61e25fda4979b3250537ebdbbe2e5721/experiment/wheeldispatch.nim#L199
- Selectors
- Timer
- DelayQueue
- setTimer
- cancelTimer
- repeatTimer
- processTimer
Cross platform means that selectors supports multi-platform multiplexing APIS such as IOCP, kqueue, epoll.
Selectors and timer are the base of async/await, for example you can use them to implement reactor model like tokio in Rust. Timer can be used for timed tasks and so on.
The initial goal is to make httpbeast support windows and it works. https://github.com/xflywind/httpx
The second goal is to supply cross-platform selectors supports for disruptek's cps and I haven't finished it.
It dosen't support js.
No, I do it just to enhance selectors in stdlib and it should be consistent with selectors. I would rather use io_uring and IOCP to implement IO engine(proactor model) if I have more free time.
Btw, tulayang's netkit library is intended to implement mio and tokio(Nonblocking IO + future(async/await) + net) in Nim. I hope my library is useful for him. https://github.com/iocrate/netkit/tree/devel/netkit/collections
I might explore multithreaded async but I need a good abstraction layer of the OS primitives (or I would need to write it myself). But it seems everyone is using ref objects except your io selector project.
And ref objects are a big no-no for multithreading.
My selectors have little difference with stdlib except that I add IOCP supports based on wepoll(C wrapper).
I'm still learning the OS primitives by so many Rust tutorials regarding system programming from scratch :)
I will implement a new IO engine from scratch as soon as I have learned them well. And I will also aid tulayang to implement his net ecosystem when appropriate.