From 3ed4683f4be5e38a0f96c493350878227b9480d2 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Tue, 10 Sep 2019 13:34:11 -0700 Subject: [PATCH] 80 cols + order of operations --- pkg/king/lib/Vere/Pier.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/king/lib/Vere/Pier.hs b/pkg/king/lib/Vere/Pier.hs index 47c25a8505..b3e4387a65 100644 --- a/pkg/king/lib/Vere/Pier.hs +++ b/pkg/king/lib/Vere/Pier.hs @@ -152,13 +152,15 @@ pier pierPath mPort (serf, log, ss) = do let ship = who (Log.identity log) let (bootEvents, startDrivers) = - drivers pierPath inst ship mPort (writeTQueue computeQ) shutdownEvent terminalSystem + drivers pierPath inst ship mPort (writeTQueue computeQ) + shutdownEvent terminalSystem io $ atomically $ for_ bootEvents (writeTQueue computeQ) tExe <- startDrivers >>= router (readTQueue executeQ) tDisk <- runPersist log persistQ (writeTQueue executeQ) - tCpu <- runCompute serf ss (readTQueue computeQ) (takeTMVar saveM) (takeTMVar shutdownM) (writeTQueue persistQ) + tCpu <- runCompute serf ss (readTQueue computeQ) (takeTMVar saveM) + (takeTMVar shutdownM) (writeTQueue persistQ) tSaveSignal <- saveSignalThread saveM @@ -287,9 +289,9 @@ runCompute serf ss getEvent getSaveSignal getShutdownSignal putResult = go :: SerfState -> RIO e () go ss = do cr <- atomically $ - CREvent <$> getEvent <|> + CRShutdown <$> getShutdownSignal <|> CRSave <$> getSaveSignal <|> - CRShutdown <$> getShutdownSignal + CREvent <$> getEvent case cr of CREvent ev -> do logEvent ev