ribosome-0.4.0.0: api extensions for nvim-hs
Safe HaskellNone
LanguageHaskell2010

Ribosome.Control.Concurrent.Wait

Synopsis

Documentation

data Retry Source #

Specifies the maximum number of retries and the interval in seconds for waitIO.

Constructors

Retry Int Double 

Instances

Instances details
Show Retry Source # 
Instance details

Defined in Ribosome.Control.Concurrent.Wait

Methods

showsPrec :: Int -> Retry -> ShowS #

show :: Retry -> String #

showList :: [Retry] -> ShowS #

Default Retry Source # 
Instance details

Defined in Ribosome.Control.Concurrent.Wait

Methods

def :: Retry #

data WaitError e Source #

Error description for waitIO

Constructors

NotStarted 
ConditionUnmet e 
forall excp.Exception excp => Thrown excp 

Instances

Instances details
Show e => Show (WaitError e) Source # 
Instance details

Defined in Ribosome.Control.Concurrent.Wait

waitIO :: MonadIO m => MonadBaseControl IO m => Retry -> m a -> (a -> m (Either e b)) -> m (Either (WaitError e) b) Source #

Execute an IO thunk repeatedly until either the supplied condition produces a Right or the maximum number of retries specified in the Retry parameter has been reached. Returns the value produced by the condition.

waitIODef :: MonadIO m => MonadBaseControl IO m => m a -> (a -> m (Either e b)) -> m (Either (WaitError e) b) Source #

Calls waitIO with the default configuration of 30 retries every 100ms.

waitIOPred :: MonadIO m => MonadBaseControl IO m => Retry -> m a -> (a -> m Bool) -> m (Either (WaitError Text) a) Source #

Same as waitIO, but the condition returns Bool and the result is the result of the thunk.

waitIOPredDef :: MonadIO m => MonadBaseControl IO m => m a -> (a -> m Bool) -> m (Either (WaitError Text) a) Source #

Calls waitIOPred with the default configuration of 30 retries every 100ms.