Make raw spawning the default.
This commit is contained in:
parent
989ae4499f
commit
b96114f774
|
@ -11,7 +11,6 @@
|
|||
(struct-out send-message)
|
||||
(struct-out send-meta-message)
|
||||
(struct-out spawn)
|
||||
(struct-out spawn-raw)
|
||||
|
||||
(struct-out on-message)
|
||||
(struct-out on-meta-message)
|
||||
|
@ -31,14 +30,12 @@
|
|||
;; -- (unsubscribe SID), to remove ALL previously-added subscriptions with this SID
|
||||
;; -- (send-message Message), to emit a message into the local medium
|
||||
;; -- (send-meta-message MetaMessage), to emit a message into the containing medium
|
||||
;; -- (spawn OtherWorldState ListOf<Action>), to start a new independent sibling in the local medium
|
||||
;; -- (spawn-raw BootK), to start a new sibling in the raw os.rkt eventing model
|
||||
;; -- (spawn BootK), to start a new sibling in the raw os.rkt eventing model
|
||||
(struct subscribe (sid event-description) #:transparent)
|
||||
(struct unsubscribe (sid) #:transparent)
|
||||
(struct send-message (body) #:transparent)
|
||||
(struct send-meta-message (body) #:transparent)
|
||||
(struct spawn (initial-state initial-actions) #:transparent)
|
||||
(struct spawn-raw (thunk) #:transparent)
|
||||
(struct spawn (thunk) #:transparent)
|
||||
|
||||
;; An EventDescription is one of
|
||||
;; -- (on-message MessagePattern (Message WorldState -> Transition)), conditionally
|
||||
|
@ -105,8 +102,8 @@
|
|||
(send-message-body a))
|
||||
(for/list [(a actions) #:when (send-meta-message? a)]
|
||||
(send-meta-message-body a))
|
||||
(for/list [(a actions) #:when (or (spawn? a) (spawn-raw? a))]
|
||||
(spawn->runnable a))))
|
||||
(for/list [(a actions) #:when (spawn? a)]
|
||||
(spawn-thunk a))))
|
||||
|
||||
(define (update-world w new-state actions)
|
||||
(world new-state
|
||||
|
@ -122,13 +119,6 @@
|
|||
(world-subscriptions w)
|
||||
actions)))
|
||||
|
||||
(define (spawn->runnable s)
|
||||
(match s
|
||||
[(spawn initial-state initial-actions)
|
||||
(apply os-big-bang initial-state initial-actions)]
|
||||
[(spawn-raw thunk)
|
||||
thunk]))
|
||||
|
||||
(define (os-big-bang initial-state . initial-actions)
|
||||
(lambda ()
|
||||
(transition->os-transition (world (void) (hash))
|
||||
|
|
Loading…
Reference in New Issue