}
l.mutex.Lock()
+
l.pending = append(l.pending, message)
l.mutex.Unlock()
}
l.mutex.Lock()
+
l.pending = append(l.pending, messages...)
l.mutex.Unlock()
// fail stops the loop with err.
func (l *TurnLoop) fail(err error) {
l.mutex.Lock()
+
l.failure = errors.Join(l.failure, err)
l.mutex.Unlock()
defer cancel()
l.mutex.Lock()
+
l.cancel = cancel
l.mutex.Unlock()
defer func() {
l.mutex.Lock()
+
l.cancel = nil
l.mutex.Unlock()
}()