priority-sync-0.2.1.1: Cooperative task prioritization.

PrioritySync.Internal.Dispatch

Synopsis

Documentation

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

Instances

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.