Branch in Verse
A branch expression starts a block of one or more async subexpressions, and any expression that follows after is executed immediately, without waiting for the branch expressions to complete.
You can use branch essentially to treat any async block of code as though it were fire-and-forget immediate, but it still must be called within an async context.
| | |
| --- | --- |
| | branch: |
| | # This block continues until completed |
| | AsyncFunction1() # Starts effectively the same time as AsyncFunction3() |
| | Method1() # Block can be mixed with immediate expressions |
| | AsyncFunction2() |
| | AsyncFunction3() # Starts effectively the same time as AsyncFunction1() |
| | # If branch block task is still running when AsyncFunction3 completes |
| | # then any remaining branch task is canceled |
branch:
This block continues until completed
AsyncFunction1() # Starts effectively the same time as AsyncFunction3() Method1() # Block can be mixed with immediate expressions AsyncFunction2() AsyncFunction3() # Starts effectively the same time as AsyncFunction1()
If branch block task is still running when AsyncFunction3 completes
then any remaining branch task is canceled
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.