spawn-dataspace --> dataspace-actor

This commit is contained in:
Tony Garnock-Jones 2017-02-25 11:16:25 -05:00
parent 783d132f25
commit ee52520a13
16 changed files with 25 additions and 25 deletions

View File

@ -61,7 +61,7 @@
(advertisement (inbound (tcp-channel us them ?))) ;; we will write to remote client (advertisement (inbound (tcp-channel us them ?))) ;; we will write to remote client
)))) ))))
(spawn-dataspace (dataspace-actor
(spawn-demand-matcher (inbound (advertise (tcp-channel (?!) (?! (tcp-listener 5999)) ?))) (spawn-demand-matcher (inbound (advertise (tcp-channel (?!) (?! (tcp-listener 5999)) ?)))
(inbound (observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?))) (inbound (observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?)))
spawn-session)) spawn-session))
@ -105,7 +105,7 @@
(subscription (inbound (advertise (tcp-channel them us ?)))) (subscription (inbound (advertise (tcp-channel them us ?))))
(advertisement (inbound (tcp-channel us them ?))))))) (advertisement (inbound (tcp-channel us them ?)))))))
(spawn-dataspace (dataspace-actor
(actor (lambda (e counter) (actor (lambda (e counter)
(match e (match e
[(message 'bump) [(message 'bump)

View File

@ -942,7 +942,7 @@
#:level-size [level-size-vec (vector 4000 2000)] #:level-size [level-size-vec (vector 4000 2000)]
#:scene [scene grassland-backdrop] #:scene [scene grassland-backdrop]
. actions) . actions)
(spawn-dataspace (dataspace-actor
(and scene (spawn-background-image level-size-vec scene)) (and scene (spawn-background-image level-size-vec scene))
(spawn-display-controller level-size-vec) (spawn-display-controller level-size-vec)
(spawn-physics-engine) (spawn-physics-engine)
@ -1045,5 +1045,5 @@
((2d-dataspace #:width 600 #:height 400) ((2d-dataspace #:width 600 #:height 400)
(spawn-keyboard-integrator) (spawn-keyboard-integrator)
(spawn-scene-manager) (spawn-scene-manager)
(spawn-dataspace (spawn-score-keeper) (dataspace-actor (spawn-score-keeper)
(spawn-level-spawner 0))) (spawn-level-spawner 0)))

View File

@ -434,7 +434,7 @@
(define current-coordinate-maps (hash)) (define current-coordinate-maps (hash))
(define-values (proc pending-transition) (define-values (proc pending-transition)
(actor->process+transition (spawn-dataspace boot-actions))) (actor->process+transition (dataspace-actor boot-actions)))
(define event-queue (make-queue)) (define event-queue (make-queue))
(define target-frame-rate 60) (define target-frame-rate 60)

View File

@ -314,7 +314,7 @@
(syntax-parse stx (syntax-parse stx
[(_ name:name script ...) [(_ name:name script ...)
(quasisyntax/loc stx (quasisyntax/loc stx
(let ((spawn-action (core:spawn-dataspace (let ((spawn-action (core:dataspace-actor
#:name name.N #:name name.N
(actor-action script ... (actor-action script ...
(schedule-action! (core:quit-dataspace)))))) (schedule-action! (core:quit-dataspace))))))

View File

@ -134,7 +134,7 @@
(define-syntax-rule (big-bang-dataspace* boot-actions extra-clause ...) (define-syntax-rule (big-bang-dataspace* boot-actions extra-clause ...)
(let-values (((proc initial-transition) (let-values (((proc initial-transition)
(actor->process+transition (spawn-dataspace boot-actions)))) (actor->process+transition (dataspace-actor boot-actions))))
(big-bang (interpret-actions (bb proc (big-bang (interpret-actions (bb proc
'() '()
'() '()

View File

@ -3,8 +3,8 @@
(provide (struct-out dataspace) (provide (struct-out dataspace)
make-dataspace make-dataspace
spawn-dataspace dataspace-actor
make-spawn-dataspace make-dataspace-actor
dataspace-handle-event dataspace-handle-event
pretty-print-dataspace) pretty-print-dataspace)
@ -109,14 +109,14 @@
(queue-append-list (dataspace-pending-action-queue w) (queue-append-list (dataspace-pending-action-queue w)
(for/list [(a actions)] (cons label a)))])) (for/list [(a actions)] (cons label a)))]))
(define-syntax spawn-dataspace (define-syntax dataspace-actor
(syntax-rules () (syntax-rules ()
[(spawn-dataspace #:name name-exp boot-action ...) [(dataspace-actor #:name name-exp boot-action ...)
(spawn-standard-relay (spawn-standard-relay
(make-spawn-dataspace #:name name-exp (lambda () (list boot-action ...))))] (make-dataspace-actor #:name name-exp (lambda () (list boot-action ...))))]
[(spawn-dataspace boot-action ...) [(dataspace-actor boot-action ...)
(spawn-standard-relay (spawn-standard-relay
(make-spawn-dataspace (lambda () (list boot-action ...))))])) (make-dataspace-actor (lambda () (list boot-action ...))))]))
(define (make-dataspace boot-actions) (define (make-dataspace boot-actions)
(dataspace (mux) (dataspace (mux)
@ -124,7 +124,7 @@
(set) (set)
(hash))) (hash)))
(define (make-spawn-dataspace #:name [name #f] boot-actions-thunk) (define (make-dataspace-actor #:name [name #f] boot-actions-thunk)
(<actor> (lambda () (<actor> (lambda ()
(list dataspace-handle-event (list dataspace-handle-event
(transition (make-dataspace (boot-actions-thunk)) '()) (transition (make-dataspace (boot-actions-thunk)) '())

View File

@ -37,7 +37,7 @@
(pub (inbound (tcp-channel us them ?))) ;; we will write to remote client (pub (inbound (tcp-channel us them ?))) ;; we will write to remote client
)))) ))))
(spawn-dataspace (dataspace-actor
(spawn-demand-matcher (inbound (advertise (tcp-channel (?!) (?! (tcp-listener 5999)) ?))) (spawn-demand-matcher (inbound (advertise (tcp-channel (?!) (?! (tcp-listener 5999)) ?)))
(inbound (observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?))) (inbound (observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?)))
spawn-session)) spawn-session))

View File

@ -40,7 +40,7 @@
(pub (inbound (tcp-channel us them ?))) ;; we will write to remote client (pub (inbound (tcp-channel us them ?))) ;; we will write to remote client
)))) ))))
(spawn-dataspace (dataspace-actor
(spawn-demand-matcher (inbound (advertise (tcp-channel (?!) (?! (tcp-listener 5999)) ?))) (spawn-demand-matcher (inbound (advertise (tcp-channel (?!) (?! (tcp-listener 5999)) ?)))
(inbound (observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?))) (inbound (observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?)))
spawn-session)) spawn-session))

View File

@ -32,7 +32,7 @@
#f)] #f)]
[_ #f])) [_ #f]))
(spawn-dataspace (actor r (void) sub-all-except-meta) (dataspace-actor (actor r (void) sub-all-except-meta)
(actor b 0 '())) (actor b 0 '()))
(define (echoer e s) (define (echoer e s)

View File

@ -10,7 +10,7 @@
(patch-seq (sub 'die) (patch-seq (sub 'die)
(sub (observe 'die)))) (sub (observe 'die))))
(spawn-dataspace (dataspace-actor
(actor (lambda (e s) (actor (lambda (e s)
(match e (match e
[(message (inbound 'die)) (quit)] [(message (inbound 'die)) (quit)]

View File

@ -2,7 +2,7 @@
;; Analogous to nc-incremental-meta-drop.rkt in the Redex model. ;; Analogous to nc-incremental-meta-drop.rkt in the Redex model.
;; Demonstrates (hopefully) correct processing of meta-interests when dropping a patch. ;; Demonstrates (hopefully) correct processing of meta-interests when dropping a patch.
(spawn-dataspace (dataspace-actor
(actor (lambda (e u) (actor (lambda (e u)
(match u (match u
[0 (transition 1 '())] [0 (transition 1 '())]

View File

@ -24,7 +24,7 @@
(require syndicate/pretty) (require syndicate/pretty)
(spawn-dataspace (dataspace-actor
(actor (lambda (e counter) (actor (lambda (e counter)
(and e (and e
(let ((new-counter (+ counter 1))) (let ((new-counter (+ counter 1)))

View File

@ -3,7 +3,7 @@
(require syndicate/pretty) (require syndicate/pretty)
(spawn-dataspace (dataspace-actor
(actor (lambda (e counter) (actor (lambda (e counter)
(and e (and e
(let ((new-counter (+ counter 1))) (let ((new-counter (+ counter 1)))

View File

@ -68,7 +68,7 @@
1 1
(patch-seq (sub (observe (set-timer ? ? ?))) (patch-seq (sub (observe (set-timer ? ? ?)))
(sub (timer-expired 'tick ?)))) (sub (timer-expired 'tick ?))))
(spawn-dataspace (actor r (void) sub-all-except-meta) (dataspace-actor (actor r (void) sub-all-except-meta)
(actor b 0 '())) (actor b 0 '()))
(actor echoer (actor echoer
(void) (void)

View File

@ -33,5 +33,5 @@
(sub-to-alarm))) (sub-to-alarm)))
(printf "Type 'quit' or 'quit-dataspace'.\n") (printf "Type 'quit' or 'quit-dataspace'.\n")
(spawn-dataspace (spawn-command-listener) (dataspace-actor (spawn-command-listener)
(spawn-ticker)) (spawn-ticker))

View File

@ -156,7 +156,7 @@
;; Action* -> Void ;; Action* -> Void
;; Runs a ground VM, booting the outermost Dataspace with the given Actions. ;; Runs a ground VM, booting the outermost Dataspace with the given Actions.
(define (run-ground . boot-actions) (define (run-ground . boot-actions)
(run-ground* (spawn-dataspace #:name 'ground boot-actions))) (run-ground* (dataspace-actor #:name 'ground boot-actions)))
;; actor -> Void ;; actor -> Void
(define (run-ground* s) (define (run-ground* s)