Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
Evars are event vars. writeEVar
trigger the execution of all the continuations associated to the readEVar
of this variable
newEVar :: TransientIO (EVar a) Source
creates an EVar
readEVar :: EVar a -> TransIO a Source
read the EVar. It only succeed when the EVar is being updated
The continuation gets registered to be executed whenever the variable is updated.
if readEVar is in any kind of loop, since each continuation is different, this will register
again the continuation. The effect is that the continuation will be executed multiple times
To avoid multiple registrations, use unsubscribe
writeEVar :: EVar t -> t -> TransIO () Source
update the EVar and execute all readEVar blocks with last in - first out priority
unsubscribe :: EVar t -> TransIO () Source
unsuscribe the last readEVar
executed for this EVar