If a parent facet terminates, its children watch for this and terminate themselves.
This commit is contained in:
parent
1e84a3507d
commit
791d2880ae
|
@ -152,7 +152,9 @@
|
||||||
;; - role: Callee
|
;; - role: Callee
|
||||||
;; Asserts LinkActive while it runs. Should send LinkResult
|
;; Asserts LinkActive while it runs. Should send LinkResult
|
||||||
;; before termination to indicate success and communicate values
|
;; before termination to indicate success and communicate values
|
||||||
;; to Caller.
|
;; to Caller. Monitors (observe LinkActive) to detect
|
||||||
|
;; termination of the Caller; upon termination of the Caller,
|
||||||
|
;; terminates itself.
|
||||||
;;
|
;;
|
||||||
;; A LinkActive is a (link-active Symbol Symbol), describing an
|
;; A LinkActive is a (link-active Symbol Symbol), describing an
|
||||||
;; ongoing relationship between the indicated caller and callee.
|
;; ongoing relationship between the indicated caller and callee.
|
||||||
|
@ -340,10 +342,13 @@
|
||||||
(define (generic-actor-behavior e s)
|
(define (generic-actor-behavior e s)
|
||||||
(match e
|
(match e
|
||||||
[(? patch/removed? p)
|
[(? patch/removed? p)
|
||||||
|
(define caller-id (actor-state-caller-id s))
|
||||||
|
(define self-id (actor-state-self-id s))
|
||||||
(define continuation-table (actor-state-continuation-table s))
|
(define continuation-table (actor-state-continuation-table s))
|
||||||
(define quit?
|
(define quit?
|
||||||
(for/or [(callee-id (trie-project/set/single (patch-removed p) link-active-projection))]
|
(or (trie-lookup (patch-removed p) (observe (link-active caller-id self-id)) #f)
|
||||||
(hash-has-key? continuation-table callee-id)))
|
(for/or [(callee-id (trie-project/set/single (patch-removed p) link-active-projection))]
|
||||||
|
(hash-has-key? continuation-table callee-id))))
|
||||||
(if quit? ;; TODO: raise exception instead? Signal the cause of the quit somehow?
|
(if quit? ;; TODO: raise exception instead? Signal the cause of the quit somehow?
|
||||||
(quit)
|
(quit)
|
||||||
#f)]
|
#f)]
|
||||||
|
@ -753,6 +758,7 @@
|
||||||
(define initial-subs
|
(define initial-subs
|
||||||
#,(if (eq? linkage-kind 'call)
|
#,(if (eq? linkage-kind 'call)
|
||||||
#`(patch-seq sub-to-callees
|
#`(patch-seq sub-to-callees
|
||||||
|
(sub (observe (link-active caller-id self-id)))
|
||||||
(core:assert (link-active caller-id self-id)))
|
(core:assert (link-active caller-id self-id)))
|
||||||
#`sub-to-callees))
|
#`sub-to-callees))
|
||||||
((extend-pending-patch *linkage-label* initial-subs) s))
|
((extend-pending-patch *linkage-label* initial-subs) s))
|
||||||
|
|
Loading…
Reference in New Issue