Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's marking that the disposal itself, when it comes time, needs to be awaited.

Keep in mind, await may need to be in both sides:

    await using connection = await getConnection()
If it was `using await` that might give some confusion if it was awaiting the left or right side or the future disposal.

Similarly, it gets fun combined with AsyncIterable:

    for await (await using connection of getAllConnections()) { }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: