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

What does @await on a method do? #41

Open
davidgiven opened this issue Sep 3, 2020 · 0 comments
Open

What does @await on a method do? #41

davidgiven opened this issue Sep 3, 2020 · 0 comments

Comments

@davidgiven
Copy link

The documentation's a bit light, and I can't tell from the implementation. This:

@await function fnord() {
  @await blockingThing();
}

...can do one of these:

  1. Calling fnord() returns immediately, queueing an orphaned promise which calls blockingThing() and resolves when blockingThing() does.
  2. Blocks until the promise returned by blockingThing() is resolved.

In the Javascript world, (1) would be meaningless as promises only resolve when they're waited for, and (2) is impossible, but haxe works differently --- can you clarify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant