ninox-d_async ~master
A minimal asyncronous framework.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
ninox.d-async
A small asyncronous framework for everyone.
License
The code in this repository is licensed under AGPL-3.0-or-later; for more details see the LICENSE
file in the repository.
Getting started
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.
Roadmap
- 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
- improve socket based io by making the underlaying socket non-blocking
- add signalhandlers for
SIGTERM
andSIGINT
- support
io_uring
under 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*
andcaptureAll
to be paralell instead of linear
- Registered by Mai Lapyst
- ~master released 12 months ago
- Bithero-Agency/ninox.d-async
- codeark.it/bithero-dlang/ninox.d-async
- AGPL-3.0-or-later
- Copyright © 2023, Mai-Lapyst
- Authors:
- Dependencies:
- ninox-d_std:optional
- Versions:
-
1.1.2 2023-Nov-25 1.1.1 2023-Nov-10 1.1.0 2023-Nov-08 1.0.0 2023-Jul-09 ~master 2023-Nov-25 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
45 downloads total
-
- Score:
- 0.3
- Short URL:
- ninox-d_async.dub.pm