Back to Hhvm

Awaitable

hphp/hack/manual/apis/Classes/HH/Awaitable/index.md

latest1.9 KB
Original Source

:::info[Note] This is a point-in-time snapshot of the API documentation from January 2026. Going forward, we will not be maintaining a public copy of these references, and recommend users to refer to the built-in signature helpers available in the Hack LSP instead for complete and up-to-date information. :::

An Awaitable value represents a value that is fetched asynchronously, such as a database access

Awaitable values are usually returned by async functions.

Use await to wait for a single Awaitable value. If you have multiple Awaitables and you want to wait for all of them together, use concurrent or helper functions like Vec\map_async.

Awaitable is not multithreading. Hack is single threaded, so Awaitable allows you to wait for multiple external results at once, rather than sequentially.

Interface Synopsis

Hack
namespace HH;

abstract class Awaitable {...}

Public Methods

<!-- HHAPIDOC -->