[Haskell] ANN: Workflow-0.5.5, TCache-0.6.4 RefSerialize-0.2.4

Alberto G. Corona agocorona at gmail.com
Thu Sep 24 15:24:15 EDT 2009


Hi

I'm proud to announce Workflow 0.5.5. This is a package intended to define
workflows as sequences of actions with he usual do notation. Such actions
may include wait for events, queue messages, etc perform processing etc for
days weeks or even years without regards for shutdowns and restarts.

Technically, Workflow includes a monad transformer that encapsulates any
computation in a state monad that bring  automatic state logging and
recovery.  A workflow can be viewed as a thread that persist across planeed
or unplanned application shutdowns.  When recovering the excution is resumed
at the last action that was logged. The process continues at the same state
as if not interruption took place.

Any feedback will be appreciated.

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. I hope that this package would be useful for very
long computations, either the programs that are CPU intensive and produce
valuable intermediate data or  programs that wait for actions from users and
others processes during days or weeks. That is typical in web applications.
 Such programs can be defined in a single monadic procedure transparently,
without regards of saving intermediate results or reinitiations at the
correct point.

This new version is not restricted to handle a single type. Every
intermediate data must be an instance of Read and Show. For complex data
types,  other persistence mechanisms can be used (see documentation).

The package is at:

http://hackage.haskell.org/package/Workflow
http://hackage.haskell.org/packages/archive/Workflow/0.5.5/Workflow-0.5.5.tar.gz


The tar archive has the documentation and some examples. Among them, a
simulation of workflow for the creation and approval of documents, with two
levels of approval and approval timeouts, It uses most of  the features of
the package.

NOTE: cabal install reports Tar checksum errors when installed, however,
such errors do not appear by downloading the tar.gz archive and
decompressing it with the unix or windows tools. I do not know why cabal
install behaves as such.


Here is a simple example: This is a counter that shows a sequence of
numbers, one a second:

*module Main where
import Control.Concurrent(threadDelay)
import System.IO (hFlush,stdout)

count n= do
                   putStr (show n ++ " " ) >> hFlush stdout >> threadDelay
1000000
                   count (n+1)

main= count 0
*
This is the same program, with the added feature of remembering the last
count after interruption (sequence.hs):

*module Main where
import Control.Workflow
import Control.Concurrent(threadDelay)
import System.IO (hFlush,stdout)

mcount n= do
           step $  putStr (show n ++ " " ) >> hFlush stdout >> threadDelay
1000000
           mcount (n+1)

main= do
  registerType :: IO ()
  registerType :: IO Int
  let start= 0 :: Int
  startWF  "count"  start   [("count", mcount)] :: IO ()
*
This is the execution log:

*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 ....
*


This package uses TCache and RefSerialize.   I also uploaded new versions of
these packages with extensive documentation and examplles included in the
tar.gz archives ( cabal install also repor checksum errors, but are OK when
downloading and installing by hand):

http://hackage.haskell.org/package/TCache
<http://hackage.haskell.org/package/TCache>
http://hackage.haskell.org/packages/archive/TCache/0.6.4/TCache-0.6.4.tar.gz


http://hackage.haskell.org/package/RefSerialize
<http://hackage.haskell.org/package/RefSerialize>
http://hackage.haskell.org/packages/archive/RefSerialize/0.2.4/RefSerialize-0.2.4.tar.gz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell/attachments/20090924/cdea6098/attachment.html


More information about the Haskell mailing list