X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=8sync%2Fsystems%2Factors.scm;h=84a5c2e3c178f168d39b981f90be4ff2b3b609f3;hb=refs%2Fheads%2Fremove-define-mhandler;hp=ea638c0e180eb5b290f88ef6bde90d36eae2669f;hpb=e268e79621f23cb7d3d9efc78093f0d85b356cdf;p=8sync.git diff --git a/8sync/systems/actors.scm b/8sync/systems/actors.scm index ea638c0..84a5c2e 100644 --- a/8sync/systems/actors.scm +++ b/8sync/systems/actors.scm @@ -70,7 +70,7 @@ <- <-wait <-reply <-reply-wait - call-with-message msg-receive + call-with-message msg-receive msg-val ez-run-hive bootstrap-message @@ -110,6 +110,11 @@ ;;; ======== +;; @@: We may want to add a deferred-reply to the below, similar to +;; what we had in XUDD, for actors which do their own response +;; queueing.... ie, that might receive messages but need to shelve +;; them to be acted upon after something else is taken care of. + (define-record-type (make-message-intern id to from action body in-reply-to wants-reply @@ -617,11 +622,20 @@ argument. Similar to call-with-values in concept." ;; Emacs: (put 'msg-receive 'scheme-indent-function 2) ;; @@: Or receive-msg or receieve-message or?? -(define-syntax-rule (msg-receive arglist the-message body ...) - (call-with-message the-message +(define-syntax-rule (msg-receive arglist message body ...) + "Call body with arglist (which can accept arguments like lambda*) +applied from the message-body of message." + (call-with-message message (lambda* arglist body ...))) +(define (msg-val message) + "Retrieve the first value from the message-body of message. +Like single value return from a procedure call. Probably the most +common case when waiting on a reply from some action invocation." + (call-with-message message + (lambda (_ val) val))) + ;;; Various API methods for actors to interact with the system ;;; ==========================================================