Skip to content

Conversation

davidbau
Copy link

This is just a preliminary demonstration of promise-style await, built as an extension of iced.

If fn is an async function that returns a Promise, then you can now say

await fn()
or
x = await fn()

Note that this mode only occurs when there is no "defer" inside the awaited expression. If a "defer" is present, the traditional iced-style await is done.

Unfinished items:

  • await fn() cannot be used in arbitrary expression context. You can only say "x = await fn()" as a statement.
  • although Promises have a clean mechanism for exceptions, this doesn't implement it.

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

Successfully merging this pull request may close these issues.

1 participant