async/await runtime
Follow-up for:
This issue was previously closed after we've decided it was too much work to implement something useful in the area of fiber-based async/await runner. Since than however we've done some proof of concept implementations with promising results. So we reopen this issue with a hope that this time we'll have the resources necessary to achieve results.
Second wind
The proof of concept is implemented in the picodata repo on this feature/async branch (picodata!265 (closed)).
It consists of:
- A simple one-directional one-shot channel type:
promise
- A reusable multi-use watcher future
alarm
- A timeout wrapper type for limiting the waiting period of future:
timeout
- A simple executor in a form of a function which blocks on the execution of a single future:
block_on
All of the futures implemented in the POC only work with the provided block_on
executor.
The POC is functional enough that it can be merged into the tarantool-module library, however it should be cleaned up beforehand.
TODO
In scope of this issue the following is expected:
-
Transfer the code from
picodata
repo to thetarantool-module
. -
Rename
alarm
intowatch
(to be more like tokio). -
Implement value passing for
watch
(like in tokio) -
Implement possibility to await more than once in receiver for
watch
-
Rename
promise
intooneshot
. - Provide documentation.
- Provide tests.
See also tokio channels naming.
Other missing functionality (not in scope)
- #102 Multi-producer, single-consumer channel (old POC channel)
- #103 (closed) Network connector api (old POC net-box) related: #81 (closed)
- Space insert/replace/... operations or transaction support (will probably require patching tarantool)
P.S.
Previous R&D work also resulted in less polished POC implementations which can be found on the tarantool-module feature/async branch and can used as basis for further work.