aboutsummaryrefslogtreecommitdiff
path: root/hsm-dummy-fail
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-01-27 14:51:28 +0000
committerPaul Oliver <contact@pauloliver.dev>2025-01-29 04:12:57 +0000
commit9d2f95bb58f856aaf9142426e90e5783c98af8f1 (patch)
tree9453d5cbed1ae2165e6c8f0824ded00d2372e7bd /hsm-dummy-fail
parent9310ba7e17f97c4570dce33552b3605155ca5c0c (diff)
Makes doc-comments cleaner/more elegant
Diffstat (limited to 'hsm-dummy-fail')
-rw-r--r--hsm-dummy-fail/Main.hs11
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 ->