X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=8sync%2Fsystems%2Firc.scm;h=1ca32439113c18928dcd231ad1a4053d711b2f82;hb=38afa0b278e17953b64764d800beaaa6368f70be;hp=030f2d3b8b68b4e7c19f778d529478d4357bdef9;hpb=57b7dfc7a351017e09bd158889ed45fa57e51289;p=8sync.git diff --git a/8sync/systems/irc.scm b/8sync/systems/irc.scm index 030f2d3..1ca3243 100755 --- a/8sync/systems/irc.scm +++ b/8sync/systems/irc.scm @@ -18,7 +18,6 @@ (define-module (8sync systems irc) #:use-module (8sync repl) - #:use-module (8sync agenda) #:use-module (8sync actors) #:use-module (srfi srfi-9) #:use-module (ice-9 getopt-long) @@ -194,18 +193,20 @@ (define (irc-bot-main-loop irc-bot message) (define socket (irc-bot-socket irc-bot)) (define line (string-trim-right (read-line socket) #\return)) - (dispatch-raw-line irc-bot line) - (cond - ;; The port's been closed for some reason, so stop looping - ((port-closed? socket) - 'done) - ;; We've reached the EOF object, which means we should close - ;; the port ourselves and stop looping - ((eof-object? (peek-char socket)) - (close socket) - 'done) - (else - (<- (actor-id irc-bot) 'main-loop)))) + (with-actor-nonblocking-ports + (lambda () + (dispatch-raw-line irc-bot line) + (cond + ;; The port's been closed for some reason, so stop looping + ((port-closed? socket) + 'done) + ;; We've reached the EOF object, which means we should close + ;; the port ourselves and stop looping + ((eof-object? (peek-char socket)) + (close socket) + 'done) + (else + (<- (actor-id irc-bot) 'main-loop)))))) (define* (irc-bot-send-line-action irc-bot message channel line #:key emote?)