A small asyncronous framework for everyone.
The code in this repository is licensed under AGPL-3.0-or-later; for more details see the LICENSE file in the repository.
This library aims to have an small but complete asyncronous solution for dlang programs.
It's based around Furure's and await; a simple example would be:
import core.time : seconds;
import ninox.async.timeout : timeout;
timeout(seconds(5)).await();Here timeout had a signature of TimeoutFuture timeout(Duration dur); where TimeoutFuture extends ninox.async.Future(T).
The future itselv implements T await(); which can be called to await the future and get the result; in out case here void since
a timeout dosnt produce a value.
To use futures, you must be in an fiber, and to achive that you simply schedule your function:
import ninox.async : gscheduler;
gscheduler.schedule(&someFunc);
Your main-function also should call gscheduler.loop(); before it's end to actually start the whole eventloop.
- improve handling / distinction of io-events
- improve way we handle futures: would like to get rid of spin-lock like codeflow
- add more io futures:
- chunked file io
- add signalhandlers for
SIGTERMandSIGINT - support
io_uringunder linux - support more platforms like windows and osx
- add thread-pool support
- add more library features such as arbitary streams
- add async variant of
awaitAllSync - improve
awaitAll*andcaptureAllto be paralell instead of linear - move from using
std.socketinAsyncSocketto usingsocket_tdirectly