actors: Make the <-* message sending procedures official, not aliases.
[8sync.git] / tests / test-actors.scm
index 2b5298c81e7e73059a7f46950cfcceabf928667d..4c8795a75f089dd263287ff532a4a8b4ae02f7c2 100644 (file)
 (define-simple-actor <antsy-caller>
   ((pester-rep actor message)
    (~display "customer> I'm calling customer service about this!\n")
-   (let ((reply (send-message-wait actor (message-ref message 'who-to-call)
-                                   'field-call)))
+   (let ((reply (<-wait actor (message-ref message 'who-to-call)
+                        'field-call)))
      (if (message-ref reply '*auto-reply* #f)
          (~display "customer> Whaaaaat?  I can't believe I got voice mail!\n")
          (begin
            (~format "*customer hears*: ~a\n" (message-ref reply 'msg))
-           (let ((reply (reply-message-wait
+           (let ((reply (<-reply-wait
                          actor reply
                          #:msg "Yes, it didn't work, I'm VERY ANGRY!")))
              (if (message-ref reply '*auto-reply* #f)
   ((field-call actor message)
    (~display "good-rep> Hm, another call from a customer...\n")
    (let ((reply
-          (reply-message-wait
+          (<-reply-wait
            actor message
            #:msg "Have you tried turning it off and on?")))
      (~format "*rep hears*: ~a\n" (message-ref reply 'msg))
    (~display "lazy-rep> I'm not answering that.\n")))
 
 (let* ((hive (make-hive))
-       (customer (hive-create-actor hive <antsy-caller>
-                                    #:id-cookie "antsy-caller"))
-       (diligent-rep (hive-create-actor hive <diligent-rep>
-                                        #:id-cookie "diligent-rep"))
-       (lazy-rep (hive-create-actor hive <lazy-rep>
-                                    #:id-cookie "lazy-rep")))
+       (customer (hive-create-actor* hive <antsy-caller> "antsy-caller"))
+       (diligent-rep (hive-create-actor* hive <diligent-rep> "diligent-rep"))
+       (lazy-rep (hive-create-actor* hive <lazy-rep> "lazy-rep")))
   ;; * Playing a tape of a diligent service rep *
   (parameterize ((%record-out (open-output-string)))
     (let* ((result (ez-run-hive
                     hive
-                    (list (hive-bootstrap-message hive customer 'pester-rep
+                    (list (bootstrap-message hive customer 'pester-rep
                                                   #:who-to-call diligent-rep))))
            (displayed-text (get-output-string (%record-out))))
       (test-equal
@@ -151,7 +148,7 @@ customer> Well then!  Harumph.\n")))
   (parameterize ((%record-out (open-output-string)))
     (let* ((result (ez-run-hive
                     hive
-                    (list (hive-bootstrap-message hive customer 'pester-rep
+                    (list (bootstrap-message hive customer 'pester-rep
                                                   #:who-to-call lazy-rep))))
            (displayed-text (get-output-string (%record-out))))
       (test-equal