VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Verse Language·Up to Community Snippets · Verse Language·76 of 114 in Verse Language

Cancelable Task Verse Snippet

Cancelable Task

Verse from mandeep/VerseMaxxing (Snippets/CancelableTask.verse), by mandeep, under the Apache-2.0 license. Pinned at commit c922eac78. Compile-checked and ready to adapt for UEFN.

  • using { /Verse.org/Concurrency }
    using { /UnrealEngine.com/Temporary/Diagnostics }
    
    
    # from Mayapple on the FN Create discord
    CancelableTask<public> := module:
        no_rollback_cancelable<public> := interface:
            Cancel<public>():void
    
        cancelable_task_base<internal> := class<abstract>:
            Task<internal>:task(void)
            CancelEvent<internal>:event()
    
        cancelable_task<public> := class(cancelable_task_base, no_rollback_cancelable):
            Cancel<override>():void=
                CancelEvent.Signal()
    
            Get<public>()<transacts>:task(void) = Task
    
        CancelableFunction<internal>(Function:type{_()<suspends>:any}, CancelEvent:event())<suspends>:void=
            race:
                Function()
                CancelEvent.Await()
    
        CancelableSpawn<public>(Function:type{_()<suspends>:any}):cancelable_task=
            CancelEvent := event(){}
            Task:task(void) = spawn{CancelableFunction(Function, CancelEvent)}

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 76 of 114
Prev
coltonkeeley projectost deprecated lottery wheel
Next
mandeep versemaxxing utils

Source

Epic Games documentation

mandeep

Apache-2.0

View original
VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse