Rename #:monitor? to #:exit-signal? in spawn's arguments.
This commit is contained in:
parent
84d769472b
commit
bee4834ed6
12
os2.rkt
12
os2.rkt
|
@ -64,7 +64,7 @@
|
|||
(rename-out [yield <yield>])
|
||||
(rename-out [at-meta-level <at-meta-level>])
|
||||
|
||||
(struct-out monitor)
|
||||
(struct-out exit-signal)
|
||||
|
||||
;; Reexports from unify.rkt for convenience
|
||||
wild
|
||||
|
@ -204,14 +204,14 @@
|
|||
(and (at-meta-level? a)
|
||||
(preaction? (at-meta-level-preaction a)))))
|
||||
|
||||
;; A Monitor instance describes the presence of a whole process, as a
|
||||
;; An ExitSignal instance describes the presence of a whole process, as a
|
||||
;; convention.
|
||||
;;
|
||||
;; TODO: revisit the idea of points-of-attachment. There's an
|
||||
;; intermediate network between the processes and the kernel, and
|
||||
;; pid-level presence could be seen as object-level presence on that
|
||||
;; network somehow.
|
||||
(struct monitor (pid debug-name) #:prefab)
|
||||
(struct exit-signal (pid debug-name) #:prefab)
|
||||
|
||||
;;---------------------------------------------------------------------------
|
||||
;; role & yield macros
|
||||
|
@ -277,17 +277,17 @@
|
|||
(define (send-feedback body) (make-send-message body 'subscriber))
|
||||
|
||||
(define (make-spawn raw-spec [k #f]
|
||||
#:monitor? [monitor? #f]
|
||||
#:exit-signal? [exit-signal? #f]
|
||||
#:debug-name [debug-name #f]
|
||||
#:state-contract [state-contract any/c])
|
||||
(match-define (boot-specification raw-main raw-contract)
|
||||
(cond [(boot-specification? raw-spec) raw-spec]
|
||||
[else (boot-specification raw-spec any/c)]))
|
||||
(define maybe-monitored-main
|
||||
(if monitor?
|
||||
(if exit-signal?
|
||||
(let ((unmonitored-main (if (procedure? raw-main) raw-main (lambda (self-pid) raw-main))))
|
||||
(lambda (self-pid)
|
||||
(define m (monitor self-pid debug-name))
|
||||
(define m (exit-signal self-pid debug-name))
|
||||
(sequence-actions (unmonitored-main self-pid)
|
||||
(role (list 'canary m) (topic-publisher m) #:state state))))
|
||||
raw-main))
|
||||
|
|
Loading…
Reference in New Issue