Commit 0d772d9f authored by Bas Lijnse's avatar Bas Lijnse

Merge branch 'revert-15c3fba6' into 'master'

Revert "Merge branch 'reinstate-testasynctask' into 'master'"

See merge request !422
parents 15c3fba6 e84c7c39
Pipeline #42284 passed with stage
in 8 minutes and 28 seconds
......@@ -5,7 +5,6 @@ import System.Process
import System.Time
import Text
import iTasks
import iTasks.Extensions.DateTime
Start world
# (start, world) = nsTime world
......@@ -24,14 +23,11 @@ where
withShared ([], []) \stdout->
externalProcess {tv_sec=0,tv_nsec=100000000} appPath ["-v","--distributedChild", toString port] Nothing 9 (Just defaultPtyOptions) stdin stdout
||- (
waitForTimer False 1 // Wait for the child to start up
>-| asyncTask "localhost" port (
get currentTimestamp >>- \(Timestamp now)->accWorld (busyLoop now 3)
)
wait (any (startsWith "SDS server listening on ") o split "\n" o concat o fst) stdout
>-| asyncTask "localhost" port (accWorld (blockSleep 5))
)
busyLoop :: !Int !Int !*World -> (!Int, !*World)
busyLoop now s world
# (Timestamp t, world) = time world
| t >= now + s = (0, world)
= busyLoop now s world
blockSleep :: !Int !*e -> (!Int, !*e)
blockSleep _ _ = code {
ccall sleep "I:I:A"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment