Workflow-0.5.5: dist/doc/Control-Workflow.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Control.Workflow</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_Control-Workflow.html")};</SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
>Workflow-0.5.5: library for transparent execution of interruptible computations</TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>Control.Workflow</FONT
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
><P
>Transparent support for interruptable computations. A workflow can be seen as a persistent thread.
The main features are:
</P
><UL
><LI
> Transparent state logging trough a monad transformer: step :: m a -> Workflow m a.
</LI
><LI
> Resume the computation state after an accidental o planned program shutdown (restartWorkflows).
</LI
><LI
>Event handling (waithFor, waitForData).
</LI
><LI
> Monitoring of workflows with state change display and other auxiliary features.
</LI
><LI
> Communications with other processes including other workflows trough persistent data objects,
inspecttion of intermediate workflow results , Queues so that no data is lost due to shutdowns
</LI
></UL
><P
>In this way, a very long computation that may take more time than the average time between
hardware or software failures, shutdowns etc. The workflow can be defined transparently in a single monadic procedure.
Besides state logging and recovery, there are a number of communication primitives that are aware
of persistence across reinitiations such are persistent queues, persistent timeouts, or wait for events
in the STM monad. These primitives permits inter-woikflow communications and communications with
external threads.
</P
><P
>This package uses TCache for persistence and event handling.
</P
><P
>It also uses the package Refserialize. This package permits to reduce the workflow state load,
since the RefSerialize package permits to serialize and deserialize complex and autoreferenced data structures without
loosing such references, this is critical when big and structured data, such are documents, suffer little
modifications across a set of workflow steps. Therefore, it is also recommended to use Refserialize for
big user-defined objects that have small pieces that suffer little modifications during the workflow. As an
added bonus, the history will show such changes with more detail.
</P
><P
>The <TT
><A HREF="Control-Workflow.html#v%3Astep"
>step</A
></TT
> primitive is the lift operation that converts a result of type <TT
>m a</TT
> to a type <TT
><TT
><A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
></TT
> m a</TT
>
with automatic state loggin and recovery. To allow such features, Every <TT
>a</TT
> must be instance of
<TT
><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
></TT
> and <TT
><A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
></TT
> (defined in the <TT
>TCache</TT
> package).
</P
><P
>In fact, Workflow can be considered as an instance of a partial monad transformed. defined as such:
</P
><PRE
>class <TT
><A HREF="Control-Workflow.html#t%3APMonadTrans"
>PMonadTrans</A
></TT
> t m a where
<TT
><A HREF="Control-Workflow.html#v%3Aplift"
>plift</A
></TT
> :: Monad m => m a -> t m a
instance (Monad m,MonadIO m, IResource a, Typeable a)
=> PMonadTrans (WF Stat) m a where
<TT
><A HREF="Control-Workflow.html#v%3Aplift"
>plift</A
></TT
> = <TT
><A HREF="Control-Workflow.html#v%3Astep"
>step</A
></TT
>
</PRE
><P
>It is partial because the lift operation is not defined for every monad <TT
>m</TT
> and data type <TT
>a</TT
> , but for monads and data
types that meet certain conditions. In this case, to be instances of <TT
>MonadIO</TT
>, <TT
>IResource</TT
> and <TT
>Typeable</TT
> respectively.
</P
><P
>to avoid to define the last two interfaces however, <TT
><A HREF="$httptopdir/doc/libraries/base/Text-Read.html#t%3ARead"
>Read</A
></TT
> and Show' can be used to derive instances of <TT
><A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
></TT
>
for most of the useful cases. This is the set of automatic derivations:
</P
><PRE
>(Read a, Show a) => <TT
><A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-RefSerialize.html#t%3ASerialize"
>Serialize</A
></TT
> a
Typeable a => <TT
><A HREF="Control-Workflow.html#t%3AIndexable"
>Indexable</A
></TT
> a (a single key for all values. enough for workflows)
(<TT
><A HREF="Control-Workflow.html#t%3AIndexable"
>Indexable</A
></TT
> a, <TT
><A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-RefSerialize.html#t%3ASerialize"
>Serialize</A
></TT
> a) => IResource a</PRE
><P
>Therefore deriving to be instance of <TT
>Read, Show</TT
> is enough for every intermediate data result along the computation
</P
><P
>Because Data.TCache.Dynamic from the package TCache is used for persistence, every data type must be registered
by using <TT
><A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IDynamic.html#v%3AregisterType"
>registerType</A
></TT
>
</P
><P
>Here is a compkete example: This is a counter that shows a sequence of numbers, one a second:
</P
><PRE
>module Main where
import Control.Concurrent(threadDelay)
import System.IO (hFlush,stdout)
count n= do
putStr (show n ++ <A HREF=" .html"
> </A
>) >> hFlush stdout >> threadDelay 1000000
count (n+1)
main= count 0</PRE
><P
>This is the same program, with the added feature of remembering the last count after interrupted:
</P
><PRE
>module Main where
import Control.Workflow
import Control.Concurrent(threadDelay)
import System.IO (hFlush,stdout)
mcount n= do
<TT
><A HREF="Control-Workflow.html#v%3Astep"
>step</A
></TT
> $ putStr (show n ++ <A HREF=" .html"
> </A
>) >> hFlush stdout >> threadDelay 1000000
mcount (n+1)
main= do
registerType :: IO ()
registerType :: IO Int
let start= 0 :: Int
startWF <A HREF="count.html"
>count</A
> start [(<A HREF="count.html"
>count</A
>, mcount)] :: IO ()</PRE
><P
>This is the execution log:
</P
><PRE
>Worflow-0.5.5demos>runghc sequence.hs
0 1 2 3 4 5 6 7 sequence.hs: win32ConsoleHandler
sequence.hs: sequence.hs: interrupted
Worflow-0.5.5demos>
Worflow-0.5.5demos>runghc sequence.hs
7 8 9 10 11 ....</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A HREF="#t%3AWorkflow"
>Workflow</A
> m l = WF Stat m l</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A HREF="#t%3AWorkflowList"
>WorkflowList</A
> m a b = [(<A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
>, a -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m b)]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AkeyResource"
>keyResource</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Aserialize"
>serialize</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Adeserialize"
>deserialize</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Atshowp"
>tshowp</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Atreadp"
>treadp</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AdefPath"
>defPath</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AreadResource"
>readResource</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AwriteResource"
>writeResource</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AdelResource"
>delResource</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IDynamic.html#v%3AregisterType"
>registerType</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> <A HREF="#t%3APMonadTrans"
>PMonadTrans</A
> t m a <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="#v%3Aplift"
>plift</A
> :: <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m => m a -> t m a</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> <A HREF="#t%3AIndexable"
>Indexable</A
> a <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="#v%3Akey"
>key</A
> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Astep"
>step</A
> :: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => m a -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AstartWF"
>startWF</A
> :: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> b, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> b) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="Control-Workflow.html#t%3AWorkflowList"
>WorkflowList</A
> m a b -> m b</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ArestartWorkflows"
>restartWorkflows</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> b, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> b) => <A HREF="Control-Workflow.html#t%3AWorkflowList"
>WorkflowList</A
> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> a b -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetStep"
>getStep</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m) => <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetAll"
>getAll</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m) => WF Stat m [a]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AlogWF"
>logWF</A
> :: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWFKeys"
>getWFKeys</A
> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> [<A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWFHistory"
>getWFHistory</A
> :: <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> Stat)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AdelWFHistory"
>delWFHistory</A
> :: <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AprintHistory"
>printHistory</A
> :: Stat -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunsafeIOtoWF"
>unsafeIOtoWF</A
> :: <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m => <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> a -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwaitFor"
>waitFor</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> b, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> b) => (b -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
>) -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> b</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwaitUntil"
>waitUntil</A
> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger"
>Integer</A
> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwaitUntilSTM"
>waitUntilSTM</A
> :: <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar"
>TVar</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
> -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsyncWrite"
>syncWrite</A
> :: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m) => <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -> WF Stat m <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwriteQueue"
>writeQueue</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwriteQueueSTM"
>writeQueueSTM</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AreadQueue"
>readQueue</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AreadQueueSTM"
>readQueueSTM</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunreadQueue"
>unreadQueue</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunreadQueueSTM"
>unreadQueueSTM</A
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetTimeSeconds"
>getTimeSeconds</A
> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger"
>Integer</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetTimeoutFlag"
>getTimeoutFlag</A
> :: <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m => <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger"
>Integer</A
> -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m (<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar"
>TVar</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
>isEmptyQueue</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisEmptyQueueSTM"
>isEmptyQueueSTM</A
> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Documentation</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A NAME="t:Workflow"
><A NAME="t%3AWorkflow"
></A
></A
><B
>Workflow</B
> m l = WF Stat m l</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A NAME="t:WorkflowList"
><A NAME="t%3AWorkflowList"
></A
></A
><B
>WorkflowList</B
> m a b = [(<A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
>, a -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m b)]</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AkeyResource"
>keyResource</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Aserialize"
>serialize</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Adeserialize"
>deserialize</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Atshowp"
>tshowp</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3Atreadp"
>treadp</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AdefPath"
>defPath</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AreadResource"
>readResource</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AwriteResource"
>writeResource</A
>, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#v%3AdelResource"
>delResource</A
>)</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IDynamic.html#v%3AregisterType"
>registerType</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> <A NAME="t:PMonadTrans"
><A NAME="t%3APMonadTrans"
></A
></A
><B
>PMonadTrans</B
> t m a <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
>PMonadTrans permits |to define a partial monad transformer. They are not defined for all kinds of data
but the ones that have instances of certain classes.That is because in the lift instance code there are some
hidden use of these classes. This also may permit an accurate control of effects.
An instance of MonadTrans is an instance of PMonadTrans
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
>Methods</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A NAME="v:plift"
><A NAME="v%3Aplift"
></A
></A
><B
>plift</B
> :: <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m => m a -> t m a</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:PMonadTrans')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:PMonadTrans" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
>(<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="Control-Workflow.html#t%3APMonadTrans"
>PMonadTrans</A
> (WF Stat) m a</TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> <A NAME="t:Indexable"
><A NAME="t%3AIndexable"
></A
></A
><B
>Indexable</B
> a <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>Indexablle can be used to derive instances of IResource
This is the set of automatic derivations:
</P
><UL
><LI
>(Read a, Show a) => Serialize a
</LI
><LI
>Typeable a => Indexable a (a single key for all values. enough for workflows)
</LI
><LI
>(Indexable a, Serialize a) => IResource a
</LI
></UL
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
>Methods</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A NAME="v:key"
><A NAME="v%3Akey"
></A
></A
><B
>key</B
> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:step"
><A NAME="v%3Astep"
></A
></A
><B
>step</B
> :: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => m a -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m a</TD
></TR
><TR
><TD CLASS="doc"
>step lifts a monadic computation to the WF monad, and provides transparent state loging and resume of computation
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:startWF"
><A NAME="v%3AstartWF"
></A
></A
><B
>startWF</B
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> b, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> b)</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>=> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
></TD
><TD CLASS="rdoc"
>name of workflow in the workflow list
</TD
></TR
><TR
><TD CLASS="arg"
>-> a</TD
><TD CLASS="rdoc"
>initial value (even use the initial value even to restart the workflow)
</TD
></TR
><TR
><TD CLASS="arg"
>-> <A HREF="Control-Workflow.html#t%3AWorkflowList"
>WorkflowList</A
> m a b</TD
><TD CLASS="rdoc"
>workflow list. t is an assoc-list of (workflow name string,Workflow methods)
</TD
></TR
><TR
><TD CLASS="arg"
>-> m b</TD
><TD CLASS="rdoc"
>result of the computation
</TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>start or continue a workflow.
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:restartWorkflows"
><A NAME="v%3ArestartWorkflows"
></A
></A
><B
>restartWorkflows</B
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> b, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> b) => <A HREF="Control-Workflow.html#t%3AWorkflowList"
>WorkflowList</A
> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> a b -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
>re-start the non finished workflows started for all initial values that are listed in the workflow list
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getStep"
><A NAME="v%3AgetStep"
></A
></A
><B
>getStep</B
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m)</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>=> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
><TD CLASS="rdoc"
>the step number. If negative, count from the current state backwards
</TD
></TR
><TR
><TD CLASS="arg"
>-> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m a</TD
><TD CLASS="rdoc"
>return the n-tn intermediate step result
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getAll"
><A NAME="v%3AgetAll"
></A
></A
><B
>getAll</B
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m) => WF Stat m [a]</TD
></TR
><TR
><TD CLASS="doc"
>return all the intermediate results. it is supposed that all the intermediate result have
the same type.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:logWF"
><A NAME="v%3AlogWF"
></A
></A
><B
>logWF</B
> :: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
>log a message in the workflow history. I can be printed out with printWFhistory
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWFKeys"
><A NAME="v%3AgetWFKeys"
></A
></A
><B
>getWFKeys</B
> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> [<A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
>]</TD
></TR
><TR
><TD CLASS="doc"
>return the list of object keys that are running
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWFHistory"
><A NAME="v%3AgetWFHistory"
></A
></A
><B
>getWFHistory</B
> :: <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> Stat)</TD
></TR
><TR
><TD CLASS="doc"
>return the current state of the computation, in the IO monad
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:delWFHistory"
><A NAME="v%3AdelWFHistory"
></A
></A
><B
>delWFHistory</B
> :: <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
>delete the workflow. Make sure that the workdlow is not running
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:printHistory"
><A NAME="v%3AprintHistory"
></A
></A
><B
>printHistory</B
> :: Stat -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
>print the state changes along the workflow, that is, all the intermediate results
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unsafeIOtoWF"
><A NAME="v%3AunsafeIOtoWF"
></A
></A
><B
>unsafeIOtoWF</B
> :: <A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m => <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> a -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m a</TD
></TR
><TR
><TD CLASS="doc"
><P
>executes a IO computation inside of the workflow monad whatever the monad encapsulated in the workflow.
Warning: this computation is executed whenever
the workflow restarts, no matter if it has been already executed previously. This is useful for intializations or debugging.
To avoid re-execution when restarting use: <TT
><TT
><A HREF="Control-Workflow.html#v%3Astep"
>step</A
></TT
> $ unsafeIOtoWF...</TT
>
</P
><P
>To perform IO actions in a workflow that encapsulates an IO monad, use step over the IO action directly:
</P
><PRE
> <TT
><A HREF="Control-Workflow.html#v%3Astep"
>step</A
></TT
> $ action</PRE
><P
>instead of
</P
><PRE
> <TT
><A HREF="Control-Workflow.html#v%3Astep"
>step</A
></TT
> $ unsafeIOtoWF $ action</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:waitFor"
><A NAME="v%3AwaitFor"
></A
></A
><B
>waitFor</B
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> b, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> b)</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>=> b -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
><TD CLASS="rdoc"
>The condition that the retrieved object must meet
</TD
></TR
><TR
><TD CLASS="arg"
>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
></TD
><TD CLASS="rdoc"
>The workflow name
</TD
></TR
><TR
><TD CLASS="arg"
>-> a</TD
><TD CLASS="rdoc"
>the INITIAL value used in the workflow to start it
</TD
></TR
><TR
><TD CLASS="arg"
>-> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> b</TD
><TD CLASS="rdoc"
>The first event that meet the condition
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:waitUntil"
><A NAME="v%3AwaitUntil"
></A
></A
><B
>waitUntil</B
> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger"
>Integer</A
> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:waitUntilSTM"
><A NAME="v%3AwaitUntilSTM"
></A
></A
><B
>waitUntilSTM</B
> :: <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar"
>TVar</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
> -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>wait until a certain clock time, in the STM monad.
This permits to compose timeouts with locks waiting for data.
</P
><UL
><LI
>example: wait for any respoinse from a Queue if no response is given in 5 minutes, it is returned True.
</LI
></UL
><PRE
>
flag <- getTimeoutFlag $ 5 * 60
ap <A HREF="- step . atomically $ readQueueSTM docQueue `orElse` waitUntilSTM flag >"
>- step . atomically $ readQueueSTM docQueue `orElse` waitUntilSTM flag ></A
> return True
case ap of
False -> <TT
><A HREF="Control-Workflow.html#v%3AlogWF"
>logWF</A
></TT
> <A HREF="False or timeout.html"
>False or timeout</A
> >> correctWF doc
True -> do
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:syncWrite"
><A NAME="v%3AsyncWrite"
></A
></A
><B
>syncWrite</B
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: (<A HREF="$httptopdir/doc/libraries/base/Control-Monad.html#t%3AMonad"
>Monad</A
> m, <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m)</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>=> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
><TD CLASS="rdoc"
>True means syncronoys: changes are inmediately saved after each step
</TD
></TR
><TR
><TD CLASS="arg"
>-> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
><TD CLASS="rdoc"
>number of seconds between saves when asyncronous
</TD
></TR
><TR
><TD CLASS="arg"
>-> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
><TD CLASS="rdoc"
>size of the cache when async
</TD
></TR
><TR
><TD CLASS="arg"
>-> WF Stat m <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
><TD CLASS="rdoc"
>in the workflow monad
</TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>change the logging policy (default is syncronous)
Workflow uses the package TCache for logging
for very fast workflow steps or when TCache is used also for other purposes , asyncronous is a better option
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:writeQueue"
><A NAME="v%3AwriteQueue"
></A
></A
><B
>writeQueue</B
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
>insert an element on top of the Queue Stack
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:writeQueueSTM"
><A NAME="v%3AwriteQueueSTM"
></A
></A
><B
>writeQueueSTM</B
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
>Like writeQueue, but in the STM monad
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:readQueue"
><A NAME="v%3AreadQueue"
></A
></A
><B
>readQueue</B
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a)</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>=> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
></TD
><TD CLASS="rdoc"
>Queue name
</TD
></TR
><TR
><TD CLASS="arg"
>-> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> a</TD
><TD CLASS="rdoc"
>the returned elems
</TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>delete elements from the Queue stack and return them in the IO monad
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:readQueueSTM"
><A NAME="v%3AreadQueueSTM"
></A
></A
><B
>readQueueSTM</B
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> a</TD
></TR
><TR
><TD CLASS="doc"
>delete elements from the Queue stack an return them. in the STM monad
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unreadQueue"
><A NAME="v%3AunreadQueue"
></A
></A
><B
>unreadQueue</B
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unreadQueueSTM"
><A NAME="v%3AunreadQueueSTM"
></A
></A
><B
>unreadQueueSTM</B
> :: (<A HREF="C:\Archivos de programa\Haskell\doc\TCache-0.6.4\html/Data-TCache-IResource.html#t%3AIResource"
>IResource</A
> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> a) => <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> a -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getTimeSeconds"
><A NAME="v%3AgetTimeSeconds"
></A
></A
><B
>getTimeSeconds</B
> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger"
>Integer</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getTimeoutFlag"
><A NAME="v%3AgetTimeoutFlag"
></A
></A
><B
>getTimeoutFlag</B
> :: <A HREF="$httptopdir/doc/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m => <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger"
>Integer</A
> -> <A HREF="Control-Workflow.html#t%3AWorkflow"
>Workflow</A
> m (<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar"
>TVar</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
>)</TD
></TR
><TR
><TD CLASS="doc"
>start the timeout and return the flag to be monitored by <TT
><A HREF="Control-Workflow.html#v%3AwaitUntilSTM"
>waitUntilSTM</A
></TT
>
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
>isEmptyQueue</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isEmptyQueueSTM"
><A NAME="v%3AisEmptyQueueSTM"
></A
></A
><B
>isEmptyQueueSTM</B
> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString"
>String</A
> -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM"
>STM</A
> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 2.4.2</TD
></TR
></TABLE
></BODY
></HTML
>