File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ sbcl --noinform --noprint $@ << EOF
4+
5+ (ql:quickload :cl-bunny.examples)
6+
7+ (in-package :cl-bunny.examples)
8+
9+ (with-connection ("amqp://")
10+ (with-channel ()
11+ (let ((msg (format nil "~{~a~^ ~}" (cdr sb-ext:*posix-argv*)))
12+ (x (exchange.fanout "logs")))
13+ (publish x msg)
14+ (format t " [x] Sent '~a'~%" msg))))
15+
16+ EOF
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ sbcl --noinform --noprint << EOF
4+
5+ (ql:quickload :cl-bunny.examples)
6+
7+ (in-package :cl-bunny.examples)
8+
9+ (with-connection ("amqp://")
10+ (with-channel ()
11+ (let ((q (queue.declare-temp)))
12+ (queue.bind q "logs")
13+ (format t " [*] Waiting for logs. To exit press CTRL+C~%")
14+ (handler-case
15+ (progn
16+ (subscribe q (lambda (message)
17+ (format t " [x] #~a~%" (message-body-string message)))
18+ :type :sync)
19+ (consume))
20+ (sb-sys:interactive-interrupt ()
21+ (sb-ext:exit))))))
22+
23+ EOF
You can’t perform that action at this time.
0 commit comments