Verse Library verse

01 Sync Expression Use

Coordinates multiple asynchronous functions using sync blocks to manage execution order and parallelism.

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

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/sync-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/sync-in-verse.md
# Section:    Sync Expression Use
# sync may also have compound expressions
# with each top-level expression its own task
sync:
    block: # task 1
        # Evaluated in serial order
        AsyncFunction1a()
        AsyncFunction1b()
    block: # task 2
        AsyncFunction2a()
        AsyncFunction2b()
        AsyncFunction2c()
    AsyncFunction3() # task 3

# AsyncFunction1a(), AsyncFunction2a() and AsyncFunction3() all start essentially at the same time
Copy full snippet

Comments

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