- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for newSource (0.1 sec)
-
okhttp/src/test/java/okhttp3/internal/cache2/RelayTest.kt
} @Test fun multipleSources() { val upstream = Buffer() upstream.writeUtf8("abcdefghijklm") val relay = edit(file, upstream, metadata, 1024) val source1 = relay.newSource()!!.buffer() val source2 = relay.newSource()!!.buffer() assertThat(source1.readUtf8()).isEqualTo("abcdefghijklm") assertThat(source2.readUtf8()).isEqualTo("abcdefghijklm") source1.close() source2.close()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 11 22:09:35 UTC 2024 - 8.1K bytes - Viewed (0) -
cmd/erasure-common.go
import ( "context" "math/rand" "sync" "time" ) func (er erasureObjects) getOnlineDisks() (newDisks []StorageAPI) { disks := er.getDisks() var wg sync.WaitGroup var mu sync.Mutex r := rand.New(rand.NewSource(time.Now().UnixNano())) for _, i := range r.Perm(len(disks)) { i := i wg.Add(1) go func() { defer wg.Done() if disks[i] == nil { return }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Aug 12 08:38:15 UTC 2024 - 2.3K bytes - Viewed (0) -
cmd/callhome.go
// initCallhome will start the callhome task in the background. func initCallhome(ctx context.Context, objAPI ObjectLayer) { if !globalCallhomeConfig.Enabled() { return } go func() { r := rand.New(rand.NewSource(time.Now().UnixNano())) // Leader node (that successfully acquires the lock inside runCallhome) // will keep performing the callhome. If the leader goes down for some reason,
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 17 16:53:34 UTC 2024 - 5.3K bytes - Viewed (0) -
internal/s3select/select_benchmark_test.go
"time" humanize "github.com/dustin/go-humanize" ) const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" func newRandString(length int) string { randSrc := rand.New(rand.NewSource(time.Now().UnixNano())) b := make([]byte, length) for i := range b { b[i] = charset[randSrc.Intn(len(charset))] } return string(b) } func genSampleCSVData(count int) []byte {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Apr 14 13:54:47 UTC 2022 - 5K bytes - Viewed (0) -
internal/lsync/lrwmutex.go
// timing randomized back-off algorithm to try again until successful func (lm *LRWMutex) lockLoop(ctx context.Context, id, source string, timeout time.Duration, isWriteLock bool) (locked bool) { r := rand.New(rand.NewSource(time.Now().UnixNano())) retryCtx, cancel := context.WithTimeout(ctx, timeout) defer cancel() for { select { case <-retryCtx.Done(): // Caller context canceled or we timedout,
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Jan 02 17:15:06 UTC 2022 - 4.8K bytes - Viewed (0) -
cmd/dynamic-timeouts_test.go
// Race test. timeout := newDynamicTimeout(time.Second, time.Millisecond) var wg sync.WaitGroup for i := 0; i < runtime.GOMAXPROCS(0); i++ { wg.Add(1) rng := rand.New(rand.NewSource(int64(i))) go func() { defer wg.Done() for i := 0; i < 100; i++ { for j := 0; j < 100; j++ { timeout.LogSuccess(time.Duration(float64(time.Second) * rng.Float64())) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Oct 14 10:08:40 UTC 2022 - 5.4K bytes - Viewed (0) -
cmd/erasure-metadata-utils_test.go
testShuffleDisks(t, z) } func Test_hashOrder(t *testing.T) { for x := 1; x < 17; x++ { t.Run(fmt.Sprintf("%d", x), func(t *testing.T) { var first [17]int rng := rand.New(rand.NewSource(0)) var tmp [16]byte rng.Read(tmp[:]) prefix := hex.EncodeToString(tmp[:]) for i := 0; i < 10000; i++ { rng.Read(tmp[:])
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Jan 18 07:03:17 UTC 2024 - 7.4K bytes - Viewed (0) -
cmd/site-replication-utils.go
peerResyncMap: make(map[string]resyncState), } go s.save(ctx) go s.init(ctx) return &s } // init site resync metrics func (sm *siteResyncMetrics) init(ctx context.Context) { r := rand.New(rand.NewSource(time.Now().UnixNano())) // Run the site resync metrics load in a loop for { if err := sm.load(ctx, newObjectLayerFn()); err == nil { <-ctx.Done() return }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Jan 18 07:03:17 UTC 2024 - 8.9K bytes - Viewed (0)