X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/f5c601f1801aaa276f8c335fcb51c373edc0b50c..496569ab5b179932c60b2924bf4c61176c8be004:/daemon.go?ds=inline diff --git a/daemon.go b/daemon.go index dd75d31..ea25318 100644 --- a/daemon.go +++ b/daemon.go @@ -44,9 +44,9 @@ type DaemonClient struct { once sync.Once } -// Accept serves each client of listener until the listener closes. A new -// client gets a ready event with the name of the agent, and a busy event when a -// turn runs. +// Accept serves each client of listener until the listener closes. A new client +// gets a ready event with the name of the agent, and a busy event when a turn +// runs. func (h *DaemonHub) Accept(ctx context.Context, listener net.Listener, l *TurnLoop) { for { conn, err := listener.Accept() @@ -167,8 +167,8 @@ func (h *DaemonHub) send(client *DaemonClient, event Event) { } } -// remove removes client, closes its connection, and ends its writer. The -// caller holds the mutex. +// remove removes client, closes its connection, and ends its writer. The caller +// holds the mutex. func (h *DaemonHub) remove(client *DaemonClient) { delete(h.clients, client) client.once.Do(func() { @@ -387,6 +387,7 @@ func daemonServe(ctx context.Context, listener net.Listener, bot *TelegramBot, w root: l, messages: messages, } + l.tools.children = runtime var workers sync.WaitGroup