]> git.giacomolli.uk - onechat/blobdiff - daemon.go
Name subtests for the behavior they prove
[onechat] / daemon.go
index dd75d316316a4195ef2b79b4fc42b3c4b27e6bcf..ea253180228d342a5343a3915a6efcbdb88afe18 100644 (file)
--- a/daemon.go
+++ b/daemon.go
@@ -44,9 +44,9 @@ type DaemonClient struct {
        once   sync.Once
 }
 
        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()
 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() {
 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,
        }
                root:     l,
                messages: messages,
        }
+
        l.tools.children = runtime
 
        var workers sync.WaitGroup
        l.tools.children = runtime
 
        var workers sync.WaitGroup