aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorTeddy Wing2021-02-14 16:39:22 +0100
committerTeddy Wing2021-02-14 16:44:19 +0100
commitfb460156f44555679ed9e6e0aa29b9b295c4054e (patch)
tree1bb4160093ec3fd152c57b37f41a02f695c6ddbc /README.md
parentbb3b8e4872de08d55dd19b662e66dd16b1d08b02 (diff)
downloadcl-wait-group-master.tar.bz2
Diffstat (limited to 'README.md')
-rw-r--r--README.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a97a392
--- /dev/null
+++ b/README.md
@@ -0,0 +1,42 @@
+wait-group
+==========
+
+Wait group provides a way to block while waiting for jobs to finish. It’s
+designed to mimic Go’s [sync.WaitGroup] in Common Lisp.
+
+
+## Example
+The following initialises a WebSocket client, sends a message, and waits for a
+response.
+
+``` common-lisp
+(defvar *client* (wsd:make-client "ws://localhost:5555/"))
+(defvar *wg* (wait-group:make-wait-group))
+
+(wsd:start-connection *client*)
+
+(wsd:on :message *client* #'(lambda (message)
+ (format t "Received: ~a~%" message)
+ (wait-group:done *wg*))
+
+(wsd:send *client* "Sending")
+(wait-group:add *wg*)
+
+(wait-group:wait *wg*)
+
+(wsd:close-connection *client*)
+```
+
+
+## Install
+Clone the project to your ASDF or Quicklisp source registry:
+
+ $ git clone https://github.com/teddywing/cl-wait-group.git ~/quicklisp/local-projects/wait-group
+
+
+## License
+Copyright © 2021 Teddy Wing. Licensed under the Mozilla Public License v. 2.0
+(see the included LICENSE file).
+
+
+[sync.WaitGroup]: https://pkg.go.dev/sync#WaitGroup