Skip to content
Minimal Racket ZeroMQ Bindings
Racket Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
zmq
.gitignore
COPYING
Makefile
README.md
info.rkt
racket-zmq.spec

README.md

Minimal Racket ZeroMQ Bindings

Subscriber

(require zmq)

(define sub
  (socket 'sub
          #:subscribe '("foo" "bar")
          #:connect '("tcp://127.0.0.1:1234")))

(for ((parts (in-producer socket-receive/list #f sub)))
  (printf "received ~s\n" parts))

Publisher

(require zmq)

(define pub
  (socket 'pub #:bind '("tcp://127.0.0.1:1234")))

(for ((i (in-producer sleep #f 1)))
  (socket-send pub "foo" "Hello World!"))

Router

(require zmq)

(define echo
  (socket 'router
          #:identity "hub"
          #:bind '("tcp://127.0.0.1:4321")))

(for ((parts (in-producer socket-receive/list #f echo)))
  (printf "received ~s\n" parts)
  (apply socket-send echo parts))
You can’t perform that action at this time.