X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=8sync%2Fsystems%2Factors.scm;h=e33a88b3658eb514da2dd21b04d85e1f6305f322;hp=7e8d9576033587cff78537d956964cf2ff7e48bb;hb=15d004d6a653a4302deae1a64a516b3ebb0da873;hpb=13cb6055e917635850e8f0e3eea5c6b0dc376e7a diff --git a/8sync/systems/actors.scm b/8sync/systems/actors.scm index 7e8d957..e33a88b 100644 --- a/8sync/systems/actors.scm +++ b/8sync/systems/actors.scm @@ -71,8 +71,10 @@ send-message send-message-wait reply-message reply-message-wait + <- <-wait <-reply <-reply-wait + ez-run-hive - hive-bootstrap-message + bootstrap-message serialize-message write-message serialize-message-pretty pprint-message @@ -246,6 +248,16 @@ If key not found and DFLT not provided, throw an error." (abort-to-prompt abort-to from-actor new-message))) +;;; Aliases! +;;; See: http://mumble.net/~jar/articles/oo-moon-weinreb.html +;;; (also worth seeing: http://mumble.net/~jar/articles/oo.html ) + +(define <- send-message) +(define <-wait send-message-wait) +(define <-reply reply-message) +(define <-reply-wait reply-message-wait) + + ;;; Main actor implementation ;;; ========================= @@ -472,13 +484,12 @@ more compact following syntax: (call-with-prompt (hive-prompt hive) thunk (lambda (kont actor message) - (let ((hive (actor-hive actor))) - ;; Register the coroutine - (hash-set! (hive-waiting-coroutines hive) - (message-id message) - (cons (actor-id actor) kont)) - ;; Send off the message - (8sync (hive-process-message hive message)))))) + ;; Register the coroutine + (hash-set! (hive-waiting-coroutines hive) + (message-id message) + (cons (actor-id actor) kont)) + ;; Send off the message + (8sync (hive-process-message hive message))))) (define (process-local-message) (let ((actor (resolve-actor-to))) @@ -620,7 +631,7 @@ an integer." (spawn-and-queue-repl-server! agenda))) (start-agenda agenda))) -(define (hive-bootstrap-message hive to-id action . message-body-args) +(define (bootstrap-message hive to-id action . message-body-args) (wrap (apply send-message hive to-id action message-body-args)))