Skip to content

Instantly share code, notes, and snippets.

@dweinstein
Created January 2, 2014 17:25
Show Gist options
  • Select an option

  • Save dweinstein/8222735 to your computer and use it in GitHub Desktop.

Select an option

Save dweinstein/8222735 to your computer and use it in GitHub Desktop.
Distributed Places with Racket
;;; Distributed Places re: http://con.racket-lang.org/2012/tewk-slides.pdf
(require racket/place
racket/place/distributed)
(provide hello-world)
(define (hello-world ch)
(printf/f "hello-world received: ∼a\n"
(place-channel-get ch))
(place-channel-put ch "Hello World\n")
(printf/f "hello-world sent: Hello World\n"))
(module+ main
(define n (create-place-node "host2"
#:listen-port 6344))
(define p (dynamic-place #:at n
(quote-module-path "..")
’hello-world))
(place-channel-put p "Hello")
(printf/f "main received: ∼a\n"
(place-channel-get p))
(place-wait p))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment