Update to earlier change making `spawn` exactly 3-ary

This commit is contained in:
Tony Garnock-Jones 2016-03-13 10:39:44 +00:00
parent 6966490f46
commit 1216fba58b
6 changed files with 22 additions and 22 deletions

View File

@ -53,9 +53,9 @@
'()))] '()))]
[_ #f])) [_ #f]))
#f #f
(sub (pong ?)) (patch-seq (sub (pong ?))
(sub 'kickoff) (sub 'kickoff)
(pub (ping src dst ?)))) (pub (ping src dst ?)))))
(define (echoer id) (define (echoer id)
(spawn (lambda (e s) (spawn (lambda (e s)
@ -64,8 +64,8 @@
(transition s (message (pong stamp)))] (transition s (message (pong stamp)))]
[_ #f])) [_ #f]))
#f #f
(sub (ping ? ? ?)) (patch-seq (sub (ping ? ? ?))
(pub (pong ?)))) (pub (pong ?)))))
(begin (begin
(run-ground (for/list [(id (in-range echoer-count))] (echoer id)) (run-ground (for/list [(id (in-range echoer-count))] (echoer id))

View File

@ -70,9 +70,9 @@
(transition s (message (tcp-channel dst src bs)))] (transition s (message (tcp-channel dst src bs)))]
[_ #f])) [_ #f]))
#f #f
(sub (advertise (tcp-channel c server-id ?))) (patch-seq (sub (advertise (tcp-channel c server-id ?)))
(sub (tcp-channel c server-id ?)) (sub (tcp-channel c server-id ?))
(pub (tcp-channel server-id c ?)))) (pub (tcp-channel server-id c ?)))))
(run-ground (spawn-timer-driver) (run-ground (spawn-timer-driver)
(spawn-tcp-driver) (spawn-tcp-driver)

View File

@ -49,9 +49,9 @@
'()))] '()))]
[_ #f])) [_ #f]))
#f #f
(sub (ping dst src ?)) (patch-seq (sub (ping dst src ?))
(sub 'kickoff) (sub 'kickoff)
(pub (ping src dst ?)))) (pub (ping src dst ?)))))
(define (echoer id) (define (echoer id)
(spawn (lambda (e s) (spawn (lambda (e s)
@ -60,8 +60,8 @@
(transition s (message (ping id src stamp)))] (transition s (message (ping id src stamp)))]
[_ #f])) [_ #f]))
#f #f
(sub (ping ? id ?)) (patch-seq (sub (ping ? id ?))
(pub (ping id ? ?)))) (pub (ping id ? ?)))))
(begin (begin
(run-ground (for/list [(id (in-range echoer-count))] (echoer id)) (run-ground (for/list [(id (in-range echoer-count))] (echoer id))

View File

@ -23,8 +23,8 @@
(transition (+ count 1) '())] (transition (+ count 1) '())]
[_ #f])) [_ #f]))
0 0
(pub (presence id)) (patch-seq (pub (presence id))
(sub (advertise (presence ?))))) (sub (advertise (presence ?))))))
(define boot-actions (for/list [(id (in-range peer-count))] (peer id))) (define boot-actions (for/list [(id (in-range peer-count))] (peer id)))
(define-values (results cpu-time wall-clock-time gc-time) (define-values (results cpu-time wall-clock-time gc-time)

View File

@ -22,9 +22,9 @@
(transition (+ count 1) '())] (transition (+ count 1) '())]
[_ #f])) [_ #f]))
0 0
(assert (client)) (patch-seq (assert (client))
;; (assert (observe (server ?))) ;; (assert (observe (server ?)))
)) )))
(define (spawn-server id) (define (spawn-server id)
(spawn (lambda (e count) (spawn (lambda (e count)
@ -34,8 +34,8 @@
(transition (+ count 1) '())] (transition (+ count 1) '())]
[_ #f])) [_ #f]))
0 0
;; (assert (server id)) (patch-seq ;; (assert (server id))
(assert (observe (client))))) (assert (observe (client))))))
(define client-action (spawn-client)) (define client-action (spawn-client))
(define server-actions (for/list [(id (in-range (- peer-count 1)))] (spawn-server id))) (define server-actions (for/list [(id (in-range (- peer-count 1)))] (spawn-server id)))

View File

@ -32,8 +32,8 @@
(transition count '()))] (transition count '()))]
[_ #f])) [_ #f]))
0 0
(pub (presence id)) (patch-seq (pub (presence id))
(sub (advertise (presence ?))))) (sub (advertise (presence ?))))))
(define start-time (current-inexact-milliseconds)) (define start-time (current-inexact-milliseconds))
(run-ground (for/list [(id (in-range peer-count))] (peer id))) (run-ground (for/list [(id (in-range peer-count))] (peer id)))