ae.utils.promise.await

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

Members

Functions

async
Promise!(T, E) async(T 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.

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

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

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>