We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Hi, The code below is an simple example of push/pull pair with :streamer device, and the backend workers run in threads, everything is OK!
push/pull
:streamer
(ql:quickload :pzmq) (ql:quickload :bordeaux-threads) (defun streamer-device (front back) (pzmq:with-sockets ((frontend :pull) (backend :push)) (pzmq:bind frontend front) (pzmq:bind backend back) (dotimes (i 2) (pzmq:with-context nil (bt:make-thread (lambda () (pzmq:with-socket recv :pull (pzmq:connect recv back) (loop (format t "Streamer pulled a msg: ~d" (pzmq:recv-string recv)))))))) (pzmq:device :streamer frontend backend) ;; Or use proxy #+:ignore(pzmq:proxy frontend backend (cffi:null-pointer)))) (defun send-streamer (endpoint) (pzmq:with-sockets ((sender :push)) (pzmq:connect sender endpoint) (pzmq:send sender "hello")))
Tests with:
(bt:make-thread (lambda () (streamer-device "tcp://127.0.0.1:5558" "tcp://127.0.0.1:5559"))) (sleep 0.5) (send-streamer "tcp://127.0.0.1:5558") (bt:make-thread (lambda () (streamer-device "tcp://127.0.0.1:5561" "ipc://workers"))) (sleep 0.5) (send-streamer "tcp://127.0.0.1:5561") (bt:make-thread (lambda () (streamer-device "tcp://127.0.0.1:5560" "inproc://workers"))) (sleep 0.5) (send-streamer "tcp://127.0.0.1:5560")
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
The code below is an simple example of
push/pull
pair with:streamer
device, and the backend workers run in threads, everything is OK!Tests with:
The text was updated successfully, but these errors were encountered: