Skip to content

Commit

Permalink
refactor(runtime): remove unnecessary sleeps
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Jun 9, 2021
1 parent b3b331f commit d15ab1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime-prototype/src/StuntDouble/ActorMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down Expand Up @@ -560,7 +560,7 @@ findTimedout now s =
})

handleEvents :: EventLoop -> IO ()
handleEvents = forever . handleEvents1Blocking
handleEvents = forever . handleEvents1

handleEvents1Blocking :: EventLoop -> IO ()
handleEvents1Blocking ls = do
Expand All @@ -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
Expand Down

0 comments on commit d15ab1d

Please sign in to comment.