Event & Task Utilities
Event & Task Utilities
Async building blocks: a cooperatively cancellable spawned task and a one-shot await/signal latch.
Original, compile-verified Verse by Bizanator (Biloxi Studios). Clean-room sample you can drop into a UEFN project and adapt.
-
# Event & Task Utilities — Biloxi Studios Inc. # # Lightweight building blocks for async coordination: a cooperatively cancellable # task you can stop from the outside, and a tiny one-shot latch you can await and # signal across concurrent code. Dependency-free. # # Teaches: spawn/await, the <suspends> effect, classes implementing awaitable(t), # cooperative cancellation (tasks can't be force-killed — they check a flag), and # Verse's `event` type for cross-task signalling. # # Example — cancellable task: # Task := SpawnCancellable(MyWork) # MyWork(State)<suspends>:void # Task.Cancel() # ask it to stop at its next check # # Example — one-shot latch: # Latch := one_shot{} # spawn{ Latch.Await(); DoSomethingOnce() } # Latch.Signal() # releases the awaiter exactly once using { /Verse.org/Simulation } using { /Verse.org/Concurrency }
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.