hphp/hack/manual/apis/Classes/HH/Awaitable/index.md
:::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.
namespace HH;
abstract class Awaitable {...}
::setOnIOWaitEnterCallback(mixed $callback): void::setOnIOWaitExitCallback(mixed $callback): void::setOnJoinCallback(mixed $callback): void->getName(): string->isFailed(): bool->isFinished(): bool->isSucceeded(): bool