diff options
author | Teddy Wing | 2021-01-31 19:51:45 +0100 |
---|---|---|
committer | Teddy Wing | 2021-01-31 19:51:45 +0100 |
commit | 13110208dbfb74a67fdd8a6165ed5857c8806d43 (patch) | |
tree | fc553ebf4dbf051987ad92fddb22d0be41056d5d /l/src/macro.lisp | |
parent | d730aaba8371012c9a0fb7afd154a44a92ef8a96 (diff) | |
download | extreload-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/src/macro.lisp')
0 files changed, 0 insertions, 0 deletions