https://github.com/dcarp/asynchronous
A D port of Python's asyncio library
https://github.com/dcarp/asynchronous
aio asynchronous asyncio coroutines d fibers multitasking python socket timer
Last synced: 23 days ago
JSON representation
A D port of Python's asyncio library
- Host: GitHub
- URL: https://github.com/dcarp/asynchronous
- Owner: dcarp
- License: bsl-1.0
- Created: 2015-01-23T00:25:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2026-03-25T21:16:48.000Z (about 1 month ago)
- Last Synced: 2026-03-26T19:11:58.682Z (about 1 month ago)
- Topics: aio, asynchronous, asyncio, coroutines, d, fibers, multitasking, python, socket, timer
- Language: D
- Size: 363 KB
- Stars: 37
- Watchers: 7
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE_1_0.txt
Awesome Lists containing this project
README
# `asynchronous`
This library provides infrastructure for writing concurrent code using coroutines, multiplexing I/O access over sockets and other resources, running network clients and servers, and other related primitives.
_It implements most of the python 3 [asyncio API](https://docs.python.org/3/library/asyncio.html)._
#### API Reference
Can be found at: http://dcarp.github.io/asynchronous/index.html
#### Implementation status
- Timers (done)
- Futures, Tasks (done)
- Sockets (done)
- Streams (done)
- Subprocesses (not implemented)
- Locks and semaphores (done)
- Queues (done)
#### Why yet another async library? What is wrong with vibe.d?
- `asynchronous` is a library and not a framework
- it is not web-oriented, compatible with `std.socket`
- arguably nicer API
- event loop start/stop control
- uses `@Coroutine` UDA to mark functions that could trigger a task (fiber) switch, although this is not enforced yet by the compiler.
#### Examples and tutorials
Some small examples can be found in the test directory or as unittests. For larger examples please use the Python/asyncio resources.
Please keep in mind that, in contrast with Python/asyncio, in D a coroutine MUST be called from within a Task, otherwise it causes a run-time error on the fiber switch. Basic rule: if not called from another coroutine, any coroutine call need to be wrapped by `ensureFuture` or `EventLoop.createTask`.