add buffers to read and write queues.

This commit is contained in:
fiatjaf
2026-03-12 17:14:18 -03:00
parent bb4093d834
commit 5a0b18e65a
+2 -2
View File
@@ -254,10 +254,10 @@ func (r *Relay) newConnection(ctx context.Context, httpClient *http.Client) erro
ticker := time.NewTicker(19 * time.Second)
// main websocket loop
readQueue := make(chan string)
readQueue := make(chan string, 64 /* add some buffer to account for processing/IO mismatches */)
r.conn = c
r.writeQueue = make(chan writeRequest)
r.writeQueue = make(chan writeRequest, 64 /* idem */)
r.closed = &atomic.Bool{}
r.closedNotify = make(chan struct{})