Monitoring.
This commit is contained in:
parent
d656694eb1
commit
218c6cc561
21
os2.rkt
21
os2.rkt
|
@ -55,6 +55,9 @@
|
||||||
(rename-out [yield <yield>])
|
(rename-out [yield <yield>])
|
||||||
(rename-out [at-meta-level <at-meta-level>])
|
(rename-out [at-meta-level <at-meta-level>])
|
||||||
|
|
||||||
|
(struct-out monitor)
|
||||||
|
spawn/monitor
|
||||||
|
|
||||||
;; Reexports from unify.rkt for convenience
|
;; Reexports from unify.rkt for convenience
|
||||||
wild
|
wild
|
||||||
wild?
|
wild?
|
||||||
|
@ -277,6 +280,24 @@
|
||||||
(or (topic-virtual? local-topic)
|
(or (topic-virtual? local-topic)
|
||||||
(not (topic-virtual? remote-topic))))
|
(not (topic-virtual? remote-topic))))
|
||||||
|
|
||||||
|
;;---------------------------------------------------------------------------
|
||||||
|
;; Monitoring.
|
||||||
|
|
||||||
|
(struct monitor (pid debug-name) #:prefab)
|
||||||
|
|
||||||
|
(define (spawn/monitor main [k #f] #:debug-name [debug-name #f])
|
||||||
|
;; 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.
|
||||||
|
(define ((monitor-transition main-fn) self-pid)
|
||||||
|
(define m (monitor self-pid debug-name))
|
||||||
|
(prefix-transition (main-fn self-pid)
|
||||||
|
(role (list 'canary m) (topic-publisher m) #:state state)))
|
||||||
|
(make-spawn (monitor-transition (if (procedure? main) main (lambda (self-pid) main)))
|
||||||
|
k
|
||||||
|
#:debug-name debug-name))
|
||||||
|
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
;; Core virtualizable virtual machine.
|
;; Core virtualizable virtual machine.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue