| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Eve.Internal.Async
Documentation
dispatchActionAsync :: (MonadIO m, HasStates base, Typeable m, Typeable base) => IO (AppT base m ()) -> ActionT base zoomed m () Source #
Dispatch an action which is generated by some IO. Note that state of the application may have changed
between calling dispatchActionAsync and running the resulting Action
asyncActionProvider :: (MonadIO m, HasStates base, Typeable m, Typeable base) => ((AppT base m () -> IO ()) -> IO ()) -> ActionT base zoomed m () Source #
This allows long-running IO processes to provide Actions to the application asyncronously.
Don't let the type signature confuse you; it's much simpler than it seems.
Let's break it down:
When you call asyncActionProvider you pass it a function which accepts a dispatch function as an argument
and then calls it with various Actions within the resulting IO.
Note that this function calls forkIO internally, so there's no need to do that yourself.