Clean up internal interfaces to actor.rkt
This commit is contained in:
parent
f638923c6f
commit
bde2d833bd
|
@ -28,7 +28,6 @@
|
||||||
rising-edge
|
rising-edge
|
||||||
(rename-out [core:message message])
|
(rename-out [core:message message])
|
||||||
|
|
||||||
suspend-script
|
|
||||||
let-event
|
let-event
|
||||||
|
|
||||||
query-value
|
query-value
|
||||||
|
@ -53,7 +52,6 @@
|
||||||
flush!
|
flush!
|
||||||
|
|
||||||
syndicate-effects-available?
|
syndicate-effects-available?
|
||||||
suspend-script*
|
|
||||||
|
|
||||||
? ;; from pattern.rkt
|
? ;; from pattern.rkt
|
||||||
|
|
||||||
|
@ -65,12 +63,6 @@
|
||||||
actor-action
|
actor-action
|
||||||
(for-syntax (rename-out [name actor-name]))
|
(for-syntax (rename-out [name actor-name]))
|
||||||
|
|
||||||
(struct-out field-descriptor)
|
|
||||||
(struct-out field-handle)
|
|
||||||
(struct-out actor-state)
|
|
||||||
(struct-out facet)
|
|
||||||
(struct-out endpoint)
|
|
||||||
|
|
||||||
pretty-print-actor-state
|
pretty-print-actor-state
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1152,6 +1144,18 @@
|
||||||
(for [(ep (in-hash-values (facet-endpoints f)))]
|
(for [(ep (in-hash-values (facet-endpoints f)))]
|
||||||
((endpoint-handler-fn ep) e (mux-interests-of mux (endpoint-id ep)) synthetic?))))
|
((endpoint-handler-fn ep) e (mux-interests-of mux (endpoint-id ep)) synthetic?))))
|
||||||
|
|
||||||
|
(module+ implementation-details
|
||||||
|
(provide actor-behavior
|
||||||
|
boot-actor
|
||||||
|
(struct-out field-descriptor)
|
||||||
|
(struct-out field-handle)
|
||||||
|
(struct-out actor-state)
|
||||||
|
(struct-out facet)
|
||||||
|
(struct-out endpoint)
|
||||||
|
|
||||||
|
suspend-script
|
||||||
|
suspend-script*))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Script suspend-and-resume.
|
;; Script suspend-and-resume.
|
||||||
|
|
||||||
|
@ -1163,11 +1167,17 @@
|
||||||
(define (call-with-syndicate-effects thunk)
|
(define (call-with-syndicate-effects thunk)
|
||||||
(call-with-continuation-prompt thunk prompt-tag))
|
(call-with-continuation-prompt thunk prompt-tag))
|
||||||
|
|
||||||
|
(define (capture-actor-actions thunk)
|
||||||
|
(call-with-syndicate-effects
|
||||||
|
(lambda ()
|
||||||
|
(with-store [(current-pending-actions '())
|
||||||
|
(current-pending-patch patch-empty)]
|
||||||
|
(define result (thunk))
|
||||||
|
(flush-pending-patch!)
|
||||||
|
(cons result (current-pending-actions))))))
|
||||||
|
|
||||||
(module+ for-module-begin
|
(module+ for-module-begin
|
||||||
(provide call-with-syndicate-effects
|
(provide capture-actor-actions))
|
||||||
flush-pending-patch!
|
|
||||||
current-pending-actions
|
|
||||||
current-pending-patch))
|
|
||||||
|
|
||||||
(define (suspend-script* where proc)
|
(define (suspend-script* where proc)
|
||||||
(when (not (in-script?))
|
(when (not (in-script?))
|
||||||
|
|
|
@ -92,12 +92,3 @@
|
||||||
final-forms)
|
final-forms)
|
||||||
remaining-forms))
|
remaining-forms))
|
||||||
(accumulate-actions '() '() (syntax->list #'(forms ...))))]))
|
(accumulate-actions '() '() (syntax->list #'(forms ...))))]))
|
||||||
|
|
||||||
(define (capture-actor-actions thunk)
|
|
||||||
(call-with-syndicate-effects
|
|
||||||
(lambda ()
|
|
||||||
(with-store [(current-pending-actions '())
|
|
||||||
(current-pending-patch patch-empty)]
|
|
||||||
(define result (thunk))
|
|
||||||
(flush-pending-patch!)
|
|
||||||
(cons result (current-pending-actions))))))
|
|
||||||
|
|
Loading…
Reference in New Issue