Verse Library verse

08 Fragment

Creates a labeled branch containing a loop that yields periodically to update state or UI without blocking.

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

# Keep a UI label ticking while this function does its real work below;
# the ticker is automatically cancelled when this function returns.
branch:
    loop:
        Sleep(1.0)
        UpdateLabel()

Comments

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