X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=cloudiTasks%2FcloudiTasks.icl;h=f5dbaceea63b921beb1879ddd183a7e149f5e8a9;hb=dd851e8574c37cad729a3ba3b4e64a548bb4422e;hp=b80d5b02c5ca4b492bdac68ae97a6bf34f90a430;hpb=9b5c1b2bb69cf3c13c1d2c9cdbd5f92464cc7312;p=clean-tests.git diff --git a/cloudiTasks/cloudiTasks.icl b/cloudiTasks/cloudiTasks.icl index b80d5b0..f5dbace 100644 --- a/cloudiTasks/cloudiTasks.icl +++ b/cloudiTasks/cloudiTasks.icl @@ -10,14 +10,26 @@ master :: Task () master = get applicationOptions >>- \eo->traceValue ("Master started on port " +++ toString eo.serverPort) +// >-| set 42 (remoteShare (sharedStore "bork" 42) {domain="localhost",port=9099}) // >-| asyncTask (ExistingNode "localhost" 9099) (blockWait 5) // >-| asyncTask "localhost" 9090 (blockWait 5) // >-| asyncTask (PrivateNode 9099) (traceValue 5 >-| traceValue 42) -// >-| asyncTaskSpawn 9099 (return 42) - >-| sleepSortPar [5,1,3,8] + >-| asyncTask "localhost" 9099 (updateInformation [] 5) +// >-| sleepSortPar [5,1,3,8] >&^ viewSharedInformation [] @! () +asyncTaskChannel :: !String !Int !((sds () (Queue r) w) -> Task a) !((sds () (Queue w) r) -> Task b) -> Task (a, b) +asyncTaskChannel host port remote local + = asyncTask host port (remote shareTo) + -&&- +where + shareTo :: (sds () (Queue r) (Queue r)) + shareTo = sdsFocus ("to-" +++ host +++ toString port) $ memoryStore "asyncITasks-channels" (Just newQueue) + + shareFro :: (sds () (Queue w) (Queue w)) + shareFro = sdsFocus ("fro-" +++ host +++ toString port) $ memoryStore "asyncITasks-channels" (Just newQueue) + blockWait :: Int -> Task Int blockWait i = accWorld (sleep i) where