miniasync 0.3.4

A minimal D application.


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:

MiniAsync

A small asyncronous framework for everyone.

Notice: miniasync will NOT recieve further updates; please switch to ninox-d_async

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 async.timeout : timeout;
timeout(seconds(5)).await();

Here timeout had a signature of TimeoutFuture timeout(Duration dur); where TimeoutFuture extends 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 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 and SIGINT
  • 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* and captureAll to be paralell instead of linear
Authors:
  • Mai-Lapyst
Sub packages:
miniasync:test
Dependencies:
none
Versions:
0.3.4 2023-Jul-09
0.3.3 2023-Apr-10
0.3.2 2023-Apr-08
0.3.1 2023-Apr-07
0.3.0 2023-Apr-07
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 43 downloads total

Score:
0.3
Short URL:
miniasync.dub.pm