polysemy-conc-0.14.1.1: Polysemy effects for concurrency
Safe HaskellNone
LanguageGHC2021

Polysemy.Conc.Race

Description

 
Synopsis

Documentation

race_ :: forall (r :: EffectRow) a. Member Race r => Sem r a -> Sem r a -> Sem r a Source #

Specialization of race for the case where both actions return the same type, obviating the need for Either.

timeout_ :: forall u (r :: EffectRow) a. (TimeUnit u, Member Race r) => Sem r a -> u -> Sem r a -> Sem r a Source #

Specialization of timeout for the case where the main action returns the same type as the fallback, obviating the need for Either.

timeoutAs :: forall u (r :: EffectRow) a b. (TimeUnit u, Member Race r) => a -> u -> Sem r b -> Sem r (Either a b) Source #

Version of timeout that takes a pure fallback value.

timeoutAs_ :: forall u (r :: EffectRow) a. (TimeUnit u, Member Race r) => a -> u -> Sem r a -> Sem r a Source #

Specialization of timeoutAs for the case where the main action return the same type as the fallback, obviating the need for Either.

timeoutU :: forall u (r :: EffectRow). (TimeUnit u, Member Race r) => u -> Sem r () -> Sem r () Source #

Specialization of timeout for unit actions.

timeoutMaybe :: forall u (r :: EffectRow) a. (TimeUnit u, Member Race r) => u -> Sem r a -> Sem r (Maybe a) Source #

Variant of timeout that returns Maybe.

timeoutStop :: forall u err (r :: EffectRow) a. (TimeUnit u, Members '[Race, Stop err] r) => err -> u -> Sem r a -> Sem r a Source #

Variant of timeout that calls Stop with the supplied error when the action times out.