From: Christopher Allan Webber Date: Mon, 31 Jul 2017 16:58:13 +0000 (-0500) Subject: Ircbot WIP. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=0738b6b6e70c8046827fabdb22c0460dd5e464b2;p=8sync.git Ircbot WIP. * demos/ircbot.scm (run-bot): Updated to use new 8sync-fibers semantics. --- diff --git a/demos/ircbot.scm b/demos/ircbot.scm index 00c48ff..c857156 100755 --- a/demos/ircbot.scm +++ b/demos/ircbot.scm @@ -26,7 +26,8 @@ (oop goops) (srfi srfi-37) (ice-9 format) - (ice-9 match)) + (ice-9 match) + (fibers conditions)) (define-class ()) @@ -102,22 +103,22 @@ (server "irc.freenode.net") (channels '("##botchat")) (repl #f)) - (define hive (make-hive)) - (define irc-bot - (bootstrap-actor* hive "irc-bot" - #:username username - #:server server - #:channels channels)) - (define repl-manager - (cond - ((string? repl) - (bootstrap-actor* hive "repl" - #:path repl)) - (repl - (bootstrap-actor* hive "repl")))) + (run-hive + (lambda (hive) + (define irc-bot + (bootstrap-actor* hive "irc-bot" + #:username username + #:server server + #:channels channels)) + (define repl-manager + (cond + ((string? repl) + (bootstrap-actor* hive "repl" + #:path repl)) + (repl + (bootstrap-actor* hive "repl")))) - ;; TODO: load REPL - (run-hive hive '())) + (wait (make-condition))))) (define (main args) (define parsed-args (parse-args "ircbot.scm" args))