Commits

badi committed b95ad9b

update example

  • Participants
  • Parent commits fd0d200

Comments (0)

Files changed (1)

File cctools-workqueue.cabal

                      .
                      Example usage:
                      .
+                     By default the master listens on 9123 on the localhost host.
+                     Start a worker:
+                     .
+                     > $ work_queue_worker -d all localhost 9123
+                     .
+                     Now we can execute the following master program:
+                     .
  > module Main where
  > 
  > import Control.Distributed.CCTools.WorkQueue
  >   specifyTag    t $ show v
  >   return t
  > 
+ > printStats :: WorkQueue -> IO ()
  > printStats q = do
  >   s <- getStats q
  >   print $ map ($ s) [tasksRunning, tasksWaiting, tasksComplete]
  > 
- > 
+ > processResult :: WorkQueue -> Task -> IO ()
  > processResult q r = do
  >   putStrLn $ "Got: " ++ show (tag r)
  >   BS.putStrLn . output $ r