priority-sync- Cooperative task prioritization.




dispatch :: (RoomGroup c, ClaimContext c, Prioritized (ClaimHandle c)) => c -> IO a -> IO (TaskHandle (Priority (ClaimHandle c)) a)Source

Perform a task on another thread. This task can be reprioritized and canceled.

data TaskHandle p a Source


Prioritized (TaskHandle p a)

Change the priority of a task. This will not work if the task has already started.

getResult :: TaskHandle p a -> STM aSource

Wait for the result from this task.

tryGetResult :: TaskHandle p a -> STM (Maybe a)Source

Non-blocking version of getResult.