Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data AsyncPriority
- doAsync :: AsyncPriority -> IO () -> MH ()
- doAsyncIO :: AsyncPriority -> ChatState -> IO () -> IO ()
- doAsyncWith :: AsyncPriority -> IO (Maybe (MH ())) -> MH ()
- doAsyncChannelMM :: DoAsyncChannelMM a
- doAsyncWithIO :: AsyncPriority -> ChatState -> IO (Maybe (MH ())) -> IO ()
- doAsyncMM :: AsyncPriority -> (Session -> IO a) -> (a -> Maybe (MH ())) -> MH ()
- tryMM :: IO a -> (a -> IO (Maybe (MH ()))) -> IO (Maybe (MH ()))
- endAsyncNOP :: ChannelId -> a -> Maybe (MH ())
- scheduleMH :: ChatResources -> MH () -> IO ()
Documentation
data AsyncPriority Source #
Priority setting for asynchronous work items. Preempt means that the queued item will be the next work item begun (i.e. it goes to the front of the queue); normal means it will go last in the queue.
doAsync :: AsyncPriority -> IO () -> MH () Source #
Run a computation in the background, ignoring any results from it.
doAsyncWith :: AsyncPriority -> IO (Maybe (MH ())) -> MH () Source #
Run a computation in the background, returning a computation to be
called on the ChatState
value.
doAsyncChannelMM :: DoAsyncChannelMM a Source #
Performs an asynchronous IO operation on a specific channel. On completion, the final argument a completion function is executed in an MH () context in the main (brick) thread.
doAsyncWithIO :: AsyncPriority -> ChatState -> IO (Maybe (MH ())) -> IO () Source #
Run a computation in the background, returning a computation to be
called on the ChatState
value.
:: AsyncPriority | the priority for this async operation |
-> (Session -> IO a) | the async MM channel-based IO operation |
-> (a -> Maybe (MH ())) | function to process the results in brick event handling context |
-> MH () |
Performs an asynchronous IO operation. On completion, the final argument a completion function is executed in an MH () context in the main (brick) thread.
:: IO a | The action to try (usually a MM API call) |
-> (a -> IO (Maybe (MH ()))) | What to do on success |
-> IO (Maybe (MH ())) |
Try to run a computation, posting an informative error
message if it fails with a MattermostServerError
.
endAsyncNOP :: ChannelId -> a -> Maybe (MH ()) Source #
Use this convenience function if no operation needs to be performed in the MH state after an async operation completes.
scheduleMH :: ChatResources -> MH () -> IO () Source #