# Wait for the player to press the button, but no longer than 5 seconds.
# Whichever happens first wins; the other is cancelled.
race:
ButtonPressed.Await() # arm A: the player acted
Sleep(5.0) # arm B: time ran out
Verse Library
verse
06 Fragment
Uses a race construct to run multiple branches simultaneously and proceeds with whichever finishes first.
verse-library/verse-concurrency-async-race-state-machines/06-fragment.verse