Verse Library verse

07 Fragment

Launches multiple tasks concurrently and returns immediately when the first finishes.

verse-library/verse-concurrency-async-race-state-machines/07-fragment.verse

# Get the quick result NOW, but let the slow background work finish on its own.
First := rush:
    QuickCheck()             # finishes first → its value returns here
    LongBackgroundJob()      # NOT cancelled — keeps running after rush returns

Comments

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