Skip to content

What does @await on a method do? #41

@davidgiven

Description

@davidgiven

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions