Source File
backoff.go
Belonging Package
github.com/gotd/td/internal/tdsync
package tdsync
import (
)
type syncBackoff struct {
b backoff.BackOff
mux sync.Mutex
}
func ( *syncBackoff) () time.Duration {
.mux.Lock()
:= .b.NextBackOff()
.mux.Unlock()
return
}
func ( *syncBackoff) () {
.mux.Lock()
.b.Reset()
.mux.Unlock()
}
// SyncBackoff decorates backoff.BackOff to be thread-safe.
func ( backoff.BackOff) backoff.BackOff {
return &syncBackoff{b: }
}
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |