- dispatch :: (RoomGroup c, ClaimContext c, Prioritized (ClaimHandle c)) => c -> IO a -> IO (TaskHandle (Priority (ClaimHandle c)) a)
- data TaskHandle p a
- reprioritize :: Prioritized p => p -> (Priority p -> Priority p) -> STM ()
- getResult :: TaskHandle p a -> STM a
- tryGetResult :: TaskHandle p a -> STM (Maybe a)
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
Prioritized (TaskHandle p a) | Change the priority of a task. This will not work if the task has already started. |
reprioritize :: Prioritized p => p -> (Priority p -> Priority p) -> STM ()Source
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
.