Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (26 sloc) 0.929 kb
;; Custom routing Router to Papa (ROUTER to REP)
(use zmq)
(include "zhelpers.scm")
;; We will do this all in one thread to emphasize the sequence
;; of events...
(define client (make-socket 'xrep)) ;; FIXME: ROUTER
(bind-socket client "ipc://routing.ipc")
(define worker (make-socket 'rep))
(socket-option-set! worker 'identity "A")
(connect-socket worker "ipc://routing.ipc")
;; Wait for the worker to connect so that when we send a message
;; with routing envelope, it will actually match the worker...
(thread-sleep! 1)
;; Send papa address, address stack, empty part, and request
"A" "address 3" "address 2" "address 1" ""
"This is the workload")
;; Worker should just get the workload
(dump-socket worker)
;; We don't play with envelopes in the worker
(send-message worker "This is the reply")
;; Now dump what we got off the ROUTER socket...
(dump-socket client)
Jump to Line
Something went wrong with that request. Please try again.