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 your BrainDead.TV / BrainDeadGuild Discord account for full access.