diff options
Diffstat (limited to 'hsm-dummy-fail')
-rw-r--r-- | hsm-dummy-fail/Main.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hsm-dummy-fail/Main.hs b/hsm-dummy-fail/Main.hs index 785304c..4844f3b 100644 --- a/hsm-dummy-fail/Main.hs +++ b/hsm-dummy-fail/Main.hs @@ -30,15 +30,16 @@ singleError :: (Concurrent :> es, Reader Env :> es) => Stream (Eff es) ByteString singleError = fromEffect $ do - -- Seemingly, the service needs to be alive for a bit for ZMQ comms to - -- kick in. env <- ask @Env + -- The service needs to remain active for a short time to ensure the ZMQ + -- message is sent. Without this delay, the service may exit before + -- the communication occurs, preventing the message from being + -- transmitted. threadDelay $ fromIntegral env.alive return $ message env.name $ Error 0 "Sent from dummy-fail service" --- Dummy fail service: --- Proof of concept. Publishes a single error that can be catched by a --- listening client. +-- Dummy Fail Service: A proof of concept that publishes a single error +-- message, which can be caught by a listening client. main :: IO () main = launch @Env "dummy-fail" withoutInputEcho $ \env logger level -> |