Enable "webserver"

This commit is contained in:
Tony Garnock-Jones 2016-01-27 21:51:51 -05:00
parent 38e3c9de0f
commit 6c98531832
1 changed files with 6 additions and 7 deletions

View File

@ -80,10 +80,10 @@
(void) (void)
(scn (subscription (udp-packet ? (udp-listener 6667) ?))))) (scn (subscription (udp-packet ? (udp-listener 6667) ?)))))
#;(let () (let ()
(define (spawn-session them us) (define (spawn-session them us)
(list (list
(send 'bump) (message 'bump)
(spawn (lambda (e s) (spawn (lambda (e s)
(match e (match e
[(message `(counter ,counter)) [(message `(counter ,counter))
@ -97,8 +97,7 @@
"TCP/IP stack</a>.</p>\n" "TCP/IP stack</a>.</p>\n"
"<p>There have been ~a requests prior to this one.</p>") "<p>There have been ~a requests prior to this one.</p>")
counter))) counter)))
(transition s (list (message #:meta-level 1 (tcp-channel us them response)) (quit (message (at-meta (tcp-channel us them response))))]
(quit)))]
[_ #f])) [_ #f]))
(void) (void)
(scn/union (subscription `(counter ,?)) (scn/union (subscription `(counter ,?))
@ -106,11 +105,11 @@
(subscription (advertise (tcp-channel them us ?)) #:meta-level 1) (subscription (advertise (tcp-channel them us ?)) #:meta-level 1)
(advertisement (tcp-channel us them ?) #:meta-level 1))))) (advertisement (tcp-channel us them ?) #:meta-level 1)))))
(spawn-world (spawn-network
(spawn (lambda (e counter) (spawn (lambda (e counter)
(match e (match e
[(message 'bump _ _) [(message 'bump)
(transition (+ counter 1) (send `(counter ,counter)))] (transition (+ counter 1) (message `(counter ,counter)))]
[_ #f])) [_ #f]))
0 0
(scn (subscription 'bump))) (scn (subscription 'bump)))