- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for NewDeadlineWriter (0.15 sec)
-
internal/ioutil/ioutil_test.go
err = work.Run(func() error { time.Sleep(450 * time.Millisecond) return nil }) if err != nil { t.Error("DeadlineWorker should succeed") } } func TestDeadlineWriter(t *testing.T) { w := NewDeadlineWriter(&sleepWriter{timeout: 500 * time.Millisecond}, 450*time.Millisecond) _, err := w.Write([]byte("1")) if err != context.DeadlineExceeded {
Registered: Sun Dec 28 19:28:13 UTC 2025 - Last Modified: Tue Feb 18 16:25:55 UTC 2025 - 5.6K bytes - Viewed (0) -
internal/ioutil/ioutil.go
io.WriteCloser timeout time.Duration err error } // NewDeadlineWriter wraps a writer to make it respect given deadline // value per Write(). If there is a blocking write, the returned Writer // will return whenever the timer hits (the return values are n=0 // and err=context.DeadlineExceeded.) func NewDeadlineWriter(w io.WriteCloser, timeout time.Duration) io.WriteCloser {
Registered: Sun Dec 28 19:28:13 UTC 2025 - Last Modified: Tue Feb 18 16:25:55 UTC 2025 - 11.1K bytes - Viewed (0) -
cmd/bitrot-streaming.go
h := algo.New() buf := globalBytePoolCap.Load().Get() rb := ringbuffer.NewBuffer(buf[:cap(buf)]).SetBlocking(true) bw := &streamingBitrotWriter{ iow: ioutil.NewDeadlineWriter(rb.WriteCloser(), globalDriveConfig.GetMaxTimeout()), closeWithErr: rb.CloseWithError, h: h, shardSize: shardSize, canClose: &sync.WaitGroup{}, byteBuf: buf, }
Registered: Sun Dec 28 19:28:13 UTC 2025 - Last Modified: Fri Jan 17 19:19:30 UTC 2025 - 6.2K bytes - Viewed (0) -
cmd/storage-rest-client.go
if err != nil { return err } defer xhttp.DrainBody(respBody) pr, pw := io.Pipe() go func() { pw.CloseWithError(waitForHTTPStream(respBody, xioutil.NewDeadlineWriter(pw, globalDriveConfig.GetMaxTimeout()))) }() mr := msgp.NewReader(pr) defer readMsgpReaderPoolPut(mr) for { var file ReadMultipleResp if err := file.DecodeMsg(mr); err != nil {Registered: Sun Dec 28 19:28:13 UTC 2025 - Last Modified: Fri Aug 08 02:38:41 UTC 2025 - 30.4K bytes - Viewed (0)