X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tests%2Ftest-actors.scm;h=0b9adb503e34a591a9b62c336257dd96db266a8e;hb=f82b19034aa588a744fff713416bd914778681eb;hp=ad81142ac28dd6bc6e414b9f52bfa01561eff625;hpb=063be529581b7004dae5ecb106bcf33729b9fef7;p=8sync.git diff --git a/tests/test-actors.scm b/tests/test-actors.scm index ad81142..0b9adb5 100644 --- a/tests/test-actors.scm +++ b/tests/test-actors.scm @@ -74,38 +74,38 @@ ;;; Test reply / autoreply ;;; ====================== -(define-simple-actor - (pester-rep (wrap-apply antsy-caller-pester-rep))) +(define-actor () + ((pester-rep (wrap-apply antsy-caller-pester-rep)))) (define* (antsy-caller-pester-rep actor message #:key who-to-call) (~display "customer> I'm calling customer service about this!\n") - (msg-receive (first-reply #:key msg) + (mbody-receive (first-reply #:key msg) (<-wait who-to-call 'field-call) (if (message-auto-reply? first-reply) (~display "customer> Whaaaaat? I can't believe I got voice mail!\n") (begin (~format "*customer hears*: ~a\n" msg) - (msg-receive (second-reply #:key *auto-reply*) + (mbody-receive (second-reply #:key *auto-reply*) (<-reply-wait first-reply #:msg "Yes, it didn't work, I'm VERY ANGRY!") (if (message-auto-reply? second-reply) (~display "customer> Well then! Harumph.\n") (error "Not an autoreply? What's going on here..."))))))) -(define-simple-actor - (field-call (wrap-apply rep-field-call))) +(define-actor () + ((field-call (wrap-apply rep-field-call)))) (define (rep-field-call actor message) (~display "good-rep> Hm, another call from a customer...\n") - (msg-receive (reply #:key msg) + (mbody-receive (reply #:key msg) (<-reply-wait message #:msg "Have you tried turning it off and on?") (~format "*rep hears*: ~a\n" msg) (~display "good-rep> I'm sorry, that's all I can do for you.\n"))) -(define-simple-actor - (field-call - (lambda (actor message) - (~display "lazy-rep> I'm not answering that.\n")))) +(define-actor () + ((field-call + (lambda (actor message) + (~display "lazy-rep> I'm not answering that.\n"))))) (let* ((hive (make-hive)) (customer (bootstrap-actor* hive "antsy-caller")) @@ -140,8 +140,8 @@ customer> Whaaaaat? I can't believe I got voice mail!\n" ;;; Cleanup tests -(define-simple-actor - (*cleanup* test-call-cleanup)) +(define-actor () + ((*cleanup* test-call-cleanup))) (define (test-call-cleanup actor message) (speak "Hey, I'm cleanin' up here!\n")) @@ -165,11 +165,11 @@ customer> Whaaaaat? I can't believe I got voice mail!\n" ;; The exploder self-destructs, even though run-hive has cleanup ;; disabled, because it cleans up on self-destruct. -(define-simple-actor - (explode (lambda (exploder message) - (speak "POOF\n") - (self-destruct exploder))) - (*cleanup* (lambda _ (speak "Cleaning up post-explosion\n")))) +(define-actor () + ((explode (lambda (exploder message) + (speak "POOF\n") + (self-destruct exploder))) + (*cleanup* (lambda _ (speak "Cleaning up post-explosion\n"))))) (with-fresh-speaker (let ((hive (make-hive)))