safe-queue

https://github.com/deadtrickster/safe-queue.git

git clone 'https://github.com/deadtrickster/safe-queue.git'

(ql:quickload :safe-queue)
1

SAFE-QUEUE

Thread-safe queues and mailboxes. Provides uniform queue/mailbox interface. On sbcl uses sb-concurrency and lparallel on others

Example

(setf q (make-mailbox))
(mailbox-send-message q 1)
(mailbox-send-message q 2)
(mailbox-send-message q 3)
(mailbox-receive-message q)
1
(mailbox-receive-message q)
2
(mailbox-receive-message q)
3
(mailbox-receive-message-no-hang q)
NIL
NIL
(mailbox-receive-message q :timeout 5)
;; hopefuly after 5 seconds
NIL
NIL
(mailbox-receive-message q)
Thread blocked

Authors

Copyright

Copyright (c) 2010-2013 3b https://github.com/3b

Copyright (c) 2013-2015 Ilya Khaprov <ilya.khaprov@publitechs.com>

License

MIT