ae.utils.promise.await

async/await-like API for asynchronous tasks combining promises and fibers.

Members

Functions

async
Promise!(T, E) async(T delegate() task, size_t size)
Promise!(T, E) async(T function() task)

Evaluates task in a new fiber, and returns a promise which is fulfilled when task exits. task may use await to block on other promises.

async
Promise!(T, E) async(T task, size_t size)

Evaluates task in a new fiber, and returns a promise which is fulfilled when task exits. task may use await to block on other promises.

await
T await(Promise!(T, E) p)

Synchronously waits until the promise p is fulfilled. Can only be called in a fiber.

Manifest constants

defaultFiberSize
enum defaultFiberSize;
Undocumented in source.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>