Ircbot WIP.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 31 Jul 2017 16:58:13 +0000 (11:58 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 3 Aug 2017 20:50:18 +0000 (15:50 -0500)
* demos/ircbot.scm (run-bot): Updated to use new 8sync-fibers
semantics.

demos/ircbot.scm

index 00c48ffe2eef8d6883802f78fd1918ba9c6353ef..c8571561d9582285c24e5601fae9c181e76a9342 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"
-                      #:username username
-                      #:server server
-                      #:channels channels))
-  (define repl-manager
-    (cond
-     ((string? repl)
-      (bootstrap-actor* hive <repl-manager> "repl"
-                        #:path repl))
-     (repl
-      (bootstrap-actor* hive <repl-manager> "repl"))))
+  (run-hive
+   (lambda (hive)
+     (define irc-bot
+       (bootstrap-actor* hive <my-irc-bot> "irc-bot"
+                         #:username username
+                         #:server server
+                         #:channels channels))
+     (define repl-manager
+       (cond
+        ((string? repl)
+         (bootstrap-actor* hive <repl-manager> "repl"
+                           #:path repl))
+        (repl
+         (bootstrap-actor* hive <repl-manager> "repl"))))
 
-  ;; TODO: load REPL
-  (run-hive hive '()))
+     (wait (make-condition)))))
 
 (define (main args)
   (define parsed-args (parse-args "ircbot.scm" args))