Created
January 2, 2014 17:25
-
-
Save dweinstein/8222735 to your computer and use it in GitHub Desktop.
Distributed Places with Racket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; 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