Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for NewSource (0.27 sec)

  1. 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()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  2. cmd/erasure-common.go

    	"time"
    
    	"github.com/minio/pkg/v2/sync/errgroup"
    )
    
    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
    			}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  3. cmd/license-update.go

    )
    
    // initlicenseUpdateJob start the periodic license update job in the background.
    func initLicenseUpdateJob(ctx context.Context, objAPI ObjectLayer) {
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside licenceUpdaterLoop)
    		// will keep performing the license update. If the leader goes down for some
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  4. 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,
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  5. 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()))
    				}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Oct 14 10:08:40 GMT 2022
    - 5.4K bytes
    - Viewed (0)
  6. 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,
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5.1K bytes
    - Viewed (1)
  7. 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 {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 14 13:54:47 GMT 2022
    - 5K bytes
    - Viewed (0)
  8. 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[:])
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  9. 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
    		}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 8.9K bytes
    - Viewed (1)
Back to top