Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples for hack lang #337

Merged
merged 15 commits into from
Jan 28, 2019
Prev Previous commit
Next Next commit
Update count.hh
  • Loading branch information
azjezz committed Jan 26, 2019
commit a5d8377113963c903fd5f2b4a534cd5d77829eeb
3 changes: 3 additions & 0 deletions examples/hack/count.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ async function count(): Awaitable<void> {
// usleep is builtin, it is not an async builtin - so it also must block the main request thread
usleep(500000);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HH\Asio\usleep()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a side note, async is not multithreading. Some async operations may use threading as an implementation detail, but in general (and for IO specifically), it's single-threaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed here : #340

}

// flush output
await $output->flushAsync();
}