extend-ground-boot!
This commit is contained in:
parent
3ff50a6f65
commit
63ea6a9d3a
|
@ -24,9 +24,4 @@
|
||||||
(server-facet/websocket id scope))))
|
(server-facet/websocket id scope))))
|
||||||
|
|
||||||
(module+ main
|
(module+ main
|
||||||
(let ((go (current-ground-dataspace)))
|
(extend-ground-boot! main))
|
||||||
(current-ground-dataspace
|
|
||||||
(lambda (boot-proc)
|
|
||||||
(go (lambda ()
|
|
||||||
(boot-proc)
|
|
||||||
(main)))))))
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
ground-assert!
|
ground-assert!
|
||||||
ground-retract!
|
ground-retract!
|
||||||
signal-background-activity!
|
signal-background-activity!
|
||||||
|
extend-ground-boot!
|
||||||
run-ground)
|
run-ground)
|
||||||
|
|
||||||
(define-logger syndicate/ground)
|
(define-logger syndicate/ground)
|
||||||
|
@ -18,6 +19,7 @@
|
||||||
(require "syntax.rkt")
|
(require "syntax.rkt")
|
||||||
|
|
||||||
(define current-ground-event-async-channel (make-parameter #f))
|
(define current-ground-event-async-channel (make-parameter #f))
|
||||||
|
(define *ground-boot-extensions* '())
|
||||||
|
|
||||||
(define (ground-enqueue! item)
|
(define (ground-enqueue! item)
|
||||||
(async-channel-put (current-ground-event-async-channel) item))
|
(async-channel-put (current-ground-event-async-channel) item))
|
||||||
|
@ -34,6 +36,9 @@
|
||||||
(define (signal-background-activity! delta)
|
(define (signal-background-activity! delta)
|
||||||
(ground-enqueue! delta))
|
(ground-enqueue! delta))
|
||||||
|
|
||||||
|
(define (extend-ground-boot! proc)
|
||||||
|
(set! *ground-boot-extensions* (cons proc *ground-boot-extensions*)))
|
||||||
|
|
||||||
(define (run-ground* boot-proc)
|
(define (run-ground* boot-proc)
|
||||||
(define ch (make-async-channel))
|
(define ch (make-async-channel))
|
||||||
(parameterize ((current-ground-event-async-channel ch))
|
(parameterize ((current-ground-event-async-channel ch))
|
||||||
|
@ -67,7 +72,12 @@
|
||||||
(set! ground-event-relay-actor (current-actor))
|
(set! ground-event-relay-actor (current-actor))
|
||||||
;; v Adds a dummy endpoint to keep this actor alive
|
;; v Adds a dummy endpoint to keep this actor alive
|
||||||
(begin/dataflow (void)))))
|
(begin/dataflow (void)))))
|
||||||
(schedule-script! (current-actor) boot-proc))))
|
(schedule-script! (current-actor)
|
||||||
|
(lambda ()
|
||||||
|
(boot-proc)
|
||||||
|
(let ((extensions (reverse *ground-boot-extensions*)))
|
||||||
|
(set! *ground-boot-extensions* '())
|
||||||
|
(for [(p (in-list extensions))] (p))))))))
|
||||||
|
|
||||||
(let loop ()
|
(let loop ()
|
||||||
(define work-remaining? (run-scripts! ds))
|
(define work-remaining? (run-scripts! ds))
|
||||||
|
|
Loading…
Reference in New Issue