- Sort Score
- Num 10 results
- Language All
Results 1 - 3 of 3 for TryWrite (0.04 seconds)
-
internal/ringbuffer/ring_buffer_test.go
err = rb.WriteByte(buf[0]) if err != nil { t.Fatalf("write failed: %v", err) } wroteBytes++ wrote.Write(buf[:1]) debugln("WRITE 3\t", 1, wroteBytes) // TryWrite n, err = rb.TryWrite(buf[:writeRng.Intn(len(buf))]) if err != nil && err != ErrAcquireLock && err != ErrTooMuchDataToWrite && err != ErrIsFull { t.Fatalf("write failed: %v", err) } wroteBytes += n
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 26.7K bytes - Click Count (0) -
internal/ringbuffer/README.md
Regular Reads will block until data is available, but not wait for a full buffer. Writes will block until there is space available and writes bigger than the buffer will wait for reads to make space. `TryRead` and `TryWrite` are still available for non-blocking reads and writes. To signify the end of the stream, close the ring buffer from the writer side with `rb.CloseWriter()`
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Wed May 15 00:11:04 GMT 2024 - 2.1K bytes - Click Count (0) -
internal/ringbuffer/ring_buffer.go
} if r.block && wrote > 0 { r.writeCond.Broadcast() } return wrote, r.setErr(err, true) } // TryWrite writes len(p) bytes from p to the underlying buf like Write, but it is not blocking. // If it has not succeeded to acquire the lock, it return 0 as n and ErrAcquireLock. func (r *RingBuffer) TryWrite(p []byte) (n int, err error) { if len(p) == 0 { return 0, r.setErr(nil, false) } ok := r.mu.TryLock()
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 13.3K bytes - Click Count (0)