Skip to content

Instantly share code, notes, and snippets.

@kawahara
Created June 28, 2014 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kawahara/5aa3a45d575a07384af6 to your computer and use it in GitHub Desktop.
Save kawahara/5aa3a45d575a07384af6 to your computer and use it in GitHub Desktop.
hacklang-async
<?hh
async function hoge() : Awaitable<void> {
var_dump('hoge1');
await SleepWaitHandle::create(1000000);
var_dump('hoge2');
}
async function run(): Awaitable<void> {
await GenArrayWaitHandle::create([hoge(), hoge()]);
}
$await = run();
$await->join();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment