transient-0.4.4: Making composable programs with multithreading, events and distributed computing

Transient.Logged

Description

Synopsis

# Documentation

Save the state of every thread at this point. If the process is re-executed with restore it will reexecute the thread from this point on..

suspend :: Typeable a => a -> TransIO a Source #

save the state of the thread that execute it and exit the transient block initiated with keep or similar . keep will return the value passed by suspend. If the process is executed again with restore it will reexecute the thread from this point on.

it is useful to insert it in finish blocks to gather error information,

logged :: Loggable a => TransientIO a -> TransientIO a Source #

write the result of the computation in the log and return it. but if there is data in the internal log, it read the data from the log and do not execute the computation.

It accept nested step's. The effect is that if the outer step is executed completely the log of the inner steps are erased. If it is not the case, the inner steps are logged this reduce the log of large computations to the minimum. That is a feature not present in the package Workflow.

 r <- logged $do logged this :: TransIO () logged that :: TransIO () logged thatOther liftIO$ print r

when print is executed, the log is just the value of r.

but at the thatOther execution the log is: [Exec,(), ()]

class (Show a, Read a, Typeable a) => Loggable a Source #

Instances

 (Show a, Read a, Typeable * a) => Loggable a Source #