Repair during macro; use during in box/client example
This commit is contained in:
parent
4b1b2a9635
commit
6b3988caf7
|
@ -32,30 +32,12 @@
|
||||||
(define client
|
(define client
|
||||||
(action (ds)
|
(action (ds)
|
||||||
(spawn (define root-facet this-facet)
|
(spawn (define root-facet this-facet)
|
||||||
(define count 0)
|
|
||||||
(at ds
|
(at ds
|
||||||
(when (asserted (BoxState $value))
|
(when (asserted (BoxState $value))
|
||||||
(send! ds (SetBox->preserves (SetBox (+ value 1)))))
|
(send! ds (SetBox->preserves (SetBox (+ value 1)))))
|
||||||
;; (during (BoxState _)
|
(during (BoxState _)
|
||||||
;; (on-start (set! count (+ count 1)))
|
(on-stop (log-info "Client detected box termination")
|
||||||
;; (on-stop (set! count (- count 1))
|
(stop-facet root-facet)))))))
|
||||||
;; (when (zero? count)
|
|
||||||
;; (log-info "Client detected box termination")
|
|
||||||
;; (stop-facet root-facet))))
|
|
||||||
(assert (Observe (:pattern (BoxState _))
|
|
||||||
(ref (entity #:assert
|
|
||||||
(action (_v _h)
|
|
||||||
(set! count (+ count 1)))
|
|
||||||
#:retract
|
|
||||||
(action (_h)
|
|
||||||
(set! count (- count 1))
|
|
||||||
(when (zero? count)
|
|
||||||
(log-info "Client detected box termination")
|
|
||||||
(stop-facet root-facet)))))))
|
|
||||||
;; (during (BoxState _)
|
|
||||||
;; (on-stop (log-info "Client detected box termination")
|
|
||||||
;; (stop-facet root-facet)))
|
|
||||||
))))
|
|
||||||
|
|
||||||
(module+ main
|
(module+ main
|
||||||
(time
|
(time
|
||||||
|
|
|
@ -166,7 +166,7 @@
|
||||||
(ref (let ((assertion-map (make-hash)))
|
(ref (let ((assertion-map (make-hash)))
|
||||||
(entity #:assert
|
(entity #:assert
|
||||||
(action (bindings handle)
|
(action (bindings handle)
|
||||||
(match-define (list #,(analyse-pattern-bindings #'pat)) bindings)
|
(match-define (list #,@(analyse-pattern-bindings #'pat)) bindings)
|
||||||
(let ((facet (react
|
(let ((facet (react
|
||||||
(facet-prevent-inert-check! this-facet)
|
(facet-prevent-inert-check! this-facet)
|
||||||
expr ...)))
|
expr ...)))
|
||||||
|
|
Loading…
Reference in New Issue