Verse Library verse

01 Race Expression Use

Runs multiple asynchronous tasks simultaneously and returns the result of whichever finishes first.

extracted-snippets/documentation/en-us/uefn/race-in-verse/01-race-expression-use.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/race-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/race-in-verse.md
# Section:    Race Expression Use
# Adding a unique result to subexpressions so it can
# be used to determine which subexpression won
Winner := race:
    block:        # task 1
        AsyncFunction1()
        1
    block:        # task 2
        AsyncFunction2a()
        AsyncFunction2b()
        AsyncFunction2c()

Comments

    Sign in to vote, comment, or suggest an edit. Sign in