Merge branch 'master' of git.martlubbers.net:clean-tests
[clean-tests.git] / cloudiTasks / cloudiTasks.icl
index 6854cf6..f5dbace 100644 (file)
@@ -19,6 +19,17 @@ master
        >&^ 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