From d15ab1dca64c7aa5985ce9eefb150b498bbd0dc7 Mon Sep 17 00:00:00 2001 From: Stevan Andjelkovic Date: Wed, 9 Jun 2021 17:29:47 +0200 Subject: [PATCH] refactor(runtime): remove unnecessary sleeps --- src/runtime-prototype/src/StuntDouble/ActorMap.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime-prototype/src/StuntDouble/ActorMap.hs b/src/runtime-prototype/src/StuntDouble/ActorMap.hs index c79caa49..43292582 100644 --- a/src/runtime-prototype/src/StuntDouble/ActorMap.hs +++ b/src/runtime-prototype/src/StuntDouble/ActorMap.hs @@ -483,7 +483,7 @@ stepHandlers s hs = let (hs', s') = shuffle s hs in do - mapM_ (\h -> h >> threadDelay 1000 {- 1 ms -}) hs' + sequence_ hs' return s' handleInbound :: EventLoop -> IO () @@ -560,7 +560,7 @@ findTimedout now s = }) handleEvents :: EventLoop -> IO () -handleEvents = forever . handleEvents1Blocking +handleEvents = forever . handleEvents1 handleEvents1Blocking :: EventLoop -> IO () handleEvents1Blocking ls = do @@ -577,7 +577,7 @@ handleEvents1 :: EventLoop -> IO () handleEvents1 ls = do me <- atomically (tryReadTBQueue (lsQueue ls)) case me of - Nothing -> threadDelay 100 -- 0.1 ms + Nothing -> return () Just e -> do handleEvent e ls `catch` \(ex :: SomeException) -> do