actors: Reflect removal of choice of whether to cleanup in self-destruct
[8sync.git] / demos / ircbot.scm
index 00c48ffe2eef8d6883802f78fd1918ba9c6353ef..81940fc66744e86206e9449922d1fb6dba44f3ec 100755 (executable)
@@ -26,7 +26,8 @@
              (oop goops)
              (srfi srfi-37)
              (ice-9 format)
-             (ice-9 match))
+             (ice-9 match)
+             (fibers conditions))
 
 (define-class <my-irc-bot> (<irc-bot>))
 
                   (server "irc.freenode.net")
                   (channels '("##botchat"))
                   (repl #f))
-  (define hive (make-hive))
-  (define irc-bot
-    (bootstrap-actor* hive <my-irc-bot> "irc-bot"
+  (run-hive
+   (lambda (hive)
+     (define irc-bot
+       (create-actor* <my-irc-bot> "irc-bot"
                       #:username username
                       #:server server
                       #:channels channels))
-  (define repl-manager
-    (cond
-     ((string? repl)
-      (bootstrap-actor* hive <repl-manager> "repl"
+     (define repl-manager
+       (cond
+        ((string? repl)
+         (create-actor* <repl-manager> "repl"
                         #:path repl))
-     (repl
-      (bootstrap-actor* hive <repl-manager> "repl"))))
+        (repl
+         (create-actor* <repl-manager> "repl"))))
 
-  ;; TODO: load REPL
-  (run-hive hive '()))
+     (wait (make-condition)))))
 
 (define (main args)
   (define parsed-args (parse-args "ircbot.scm" args))