Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- allocateActuated :: MonadUnliftIO m => (UnliftIO m -> Event () -> MomentIO ()) -> ResourceT m EventNetwork
- allocatePaused :: MonadUnliftIO m => (UnliftIO m -> MomentIO ()) -> ResourceT m EventNetwork
- eventHandler :: (MonadResource m, MonadIO io) => ((a -> io ()) -> m ReleaseKey) -> ResourceT m (MomentIO (Event a))
- debounce :: Eq a => a -> Event a -> MomentIO (Event a)
- reactimateDebugShow :: (Show a, MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => (m () -> IO ()) -> Event a -> MomentIO ()
- timer :: MonadUnliftIO m => Int -> ResourceT m (MomentIO (Event Double))
- observe :: MonadUnliftIO m => Var a -> ResourceT m (MomentIO (Event a))
- pushWorkerInput :: HasInput var => var -> Event (GetInput var) -> MomentIO ()
- pushWorkerInputJust :: HasInput var => var -> Event (Maybe (GetInput var)) -> MomentIO ()
- pushWorkerOutput :: HasOutput var => var -> Event (GetOutput var) -> MomentIO ()
- pushWorkerOutputJust :: HasOutput var => var -> Event (Maybe (GetOutput var)) -> MomentIO ()
Network setup
allocateActuated :: MonadUnliftIO m => (UnliftIO m -> Event () -> MomentIO ()) -> ResourceT m EventNetwork Source #
Set up a network, run it and fire the started event before returning.
allocatePaused :: MonadUnliftIO m => (UnliftIO m -> MomentIO ()) -> ResourceT m EventNetwork Source #
Set up a network, passing a current context to the network-building function.
The network would pause when leaving resource region.
Event utilities
eventHandler :: (MonadResource m, MonadIO io) => ((a -> io ()) -> m ReleaseKey) -> ResourceT m (MomentIO (Event a)) Source #
Make an Event
that can be fired by a callback registered in a current resource region.
debounce :: Eq a => a -> Event a -> MomentIO (Event a) Source #
Filter out successive events with the same data.
The output event will be delayed by one step due to reactimate
use.
:: (Show a, MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) | |
=> (m () -> IO ()) | Unlift into application |
-> Event a | Event to monitor |
-> MomentIO () |
Dump event contents to application debug log.
Deprecated: Use Engine.ReactiveBanana.Timer.every
An async process that will fire monotonic timestamp events and self-adjust for the delays induced by its handling.
Engine.Worker interface
From workers to networks
observe :: MonadUnliftIO m => Var a -> ResourceT m (MomentIO (Event a)) Source #
Convert Var
updates into events.
From networks to workers
pushWorkerInput :: HasInput var => var -> Event (GetInput var) -> MomentIO () Source #
Set worker input to event contents.
pushWorkerInputJust :: HasInput var => var -> Event (Maybe (GetInput var)) -> MomentIO () Source #
Set worker input to event contents, if present.
pushWorkerOutput :: HasOutput var => var -> Event (GetOutput var) -> MomentIO () Source #
Set worker output to event contents.