- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for NewDeadlineWriter (0.1 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 Nov 03 19:28:11 UTC 2024 - Last Modified: Wed May 22 23:07:14 UTC 2024 - 5.5K 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 Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jul 26 12:55:01 UTC 2024 - 10.9K 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 Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Aug 21 12:20:54 UTC 2024 - 6K 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, ioutil.NewDeadlineWriter(pw, globalDriveConfig.GetMaxTimeout()))) }() mr := msgp.NewReader(pr) defer readMsgpReaderPoolPut(mr) for { var file ReadMultipleResp if err := file.DecodeMsg(mr); err != nil {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Oct 13 13:07:21 UTC 2024 - 30.2K bytes - Viewed (0)