aboutsummaryrefslogtreecommitdiffstats
path: root/l/extreload.asd
diff options
context:
space:
mode:
authorTeddy Wing2021-01-31 19:51:45 +0100
committerTeddy Wing2021-01-31 19:51:45 +0100
commit13110208dbfb74a67fdd8a6165ed5857c8806d43 (patch)
treefc553ebf4dbf051987ad92fddb22d0be41056d5d /l/extreload.asd
parentd730aaba8371012c9a0fb7afd154a44a92ef8a96 (diff)
downloadextreload-13110208dbfb74a67fdd8a6165ed5857c8806d43.tar.bz2
main: Replace `sleep` call with a `wait-group`
The `sleep` call allowed me to test the behaviour of the program, since without it, it would exit before the WebSocket messages had a chance to be sent and received. But we shouldn't be waiting a fixed number of seconds for the program to execute. Instead, we should only keep the program alive as long as there are messages to be sent and received. This adds a Go-style wait group using my wait-group library that increments the wait group when we send a WebSocket message, and decrements it when we receive a WebSocket response. That allows us to keep the program alive only for the amount of time necessary for the messages to be exchanged.
Diffstat (limited to 'l/extreload.asd')
-rw-r--r--l/extreload.asd3
1 files changed, 2 insertions, 1 deletions
diff --git a/l/extreload.asd b/l/extreload.asd
index 21a5329..8a1cfc2 100644
--- a/l/extreload.asd
+++ b/l/extreload.asd
@@ -1,7 +1,8 @@
(asdf:defsystem extreload
:version "0.0.1"
:depends-on (:jsown
- :websocket-driver-client)
+ :wait-group
+ :websocket-driver-client)
:components ((:module "src"
:serial t
:components ((:file "package")