3 import Data.Func, Data.Functor, Data.Tuple
7 Start w = doTasks master w
11 = get applicationOptions
12 >>- \eo->traceValue ("Master started on port " +++ toString eo.serverPort)
13 // >-| set 42 (remoteShare (sharedStore "bork" 42) {domain="localhost",port=9099})
14 // >-| asyncTask (ExistingNode "localhost" 9099) (blockWait 5)
15 // >-| asyncTask "localhost" 9090 (blockWait 5)
16 // >-| asyncTask (PrivateNode 9099) (traceValue 5 >-| traceValue 42)
17 >-| asyncTask "localhost" 9099 (updateInformation [] 5)
18 // >-| sleepSortPar [5,1,3,8]
19 >&^ viewSharedInformation []
22 blockWait :: Int -> Task Int
23 blockWait i = accWorld (sleep i)
25 sleep :: !Int !*e -> (!Int, !*e)
30 sleepSortPar :: [Int] -> Task [Int]
31 sleepSortPar numbers = parallel
33 asyncTaskSpawn port (blockWait num)
34 >-| appendTask Embedded (\_->return num) stl
37 & port <- [9092..9099]
38 ] [] @? \tv->case tv of
41 # r = [v\\(_, Value v True)<-ts]
42 = Value r (length r == length numbers)