Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 197 for channel (0.18 sec)

  1. cmd/service.go

    	// Close when we reach 0
    	globalServiceFreezeCnt--
    	if globalServiceFreezeCnt <= 0 {
    		// Set to a nil channel.
    		var _ch chan struct{}
    		if val := globalServiceFreeze.Swap(_ch); val != nil {
    			if ch, ok := val.(chan struct{}); ok && ch != nil {
    				// Close previous non-nil channel.
    				xioutil.SafeClose(ch)
    			}
    		}
    		globalServiceFreezeCnt = 0 // Don't risk going negative.
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Feb 28 07:02:14 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. cmd/erasure.go

    		Info: dataUsageCacheInfo{
    			Name:      dataUsageRoot,
    			NextCycle: oldCache.Info.NextCycle,
    		},
    		Cache: make(map[string]dataUsageEntry, len(oldCache.Cache)),
    	}
    
    	// Put all buckets into channel.
    	bucketCh := make(chan BucketInfo, len(buckets))
    
    	// Shuffle buckets to ensure total randomness of buckets, being scanned.
    	// Otherwise same set of buckets get scanned across erasure sets always.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 06:32:14 GMT 2024
    - 16K bytes
    - Viewed (1)
  3. internal/grid/grid.go

    		return len(p), nil
    	case <-w.ctx.Done():
    		return 0, context.Cause(w.ctx)
    	}
    }
    
    // WriterToChannel will return an io.Writer that writes to the given channel.
    // The context both allows returning errors on writes and to ensure that
    // this isn't abandoned if the channel is no longer being read from.
    func WriterToChannel(ctx context.Context, ch chan<- []byte) io.Writer {
    	return &writerWrapper{ch: ch, ctx: ctx}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Apr 02 15:56:18 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  4. internal/ioutil/ioutil.go

    	dw := &DeadlineWorker{
    		timeout: timeout,
    	}
    	return dw
    }
    
    // Run runs the given function, passing it a stopper channel. If the deadline passes before
    // the function finishes executing, Run returns context.DeadlineExceeded to the caller.
    // channel so that the work function can attempt to exit gracefully.
    // Multiple calls to Run will run independently of each other.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 11:26:59 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  5. internal/logger/target/http/http.go

    	ctx, cancel := context.WithCancel(ctx)
    	h.storeCtxCancel = cancel
    	h.lastStarted = time.Now()
    	go h.startQueueProcessor(ctx, true)
    	store.StreamItems(h.store, h, ctx.Done(), h.config.LogOnceIf)
    	return nil
    }
    
    func (h *Target) initMemoryStore(ctx context.Context) (err error) {
    	ctx, cancel := context.WithCancel(ctx)
    	h.storeCtxCancel = cancel
    	h.lastStarted = time.Now()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 25 16:44:20 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  6. cmd/metacache-stream.go

    		if err != nil {
    			return err
    		}
    		if w.reuseBlocks || o.reusable {
    			metaDataPoolPut(o.metadata)
    		}
    	}
    
    	return nil
    }
    
    // stream entries to the output.
    // The returned channel should be closed when done.
    // Any error is reported when closing the metacacheWriter.
    func (w *metacacheWriter) stream() (chan<- metaCacheEntry, error) {
    	if w.creator != nil {
    		err := w.creator()
    		w.creator = nil
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  7. cmd/metrics-v2_test.go

    		},
    	}
    	ticker := time.NewTicker(1 * time.Millisecond)
    	defer ticker.Stop()
    	for _, obs := range observations {
    		// Send observations once every 1ms, to simulate delay between
    		// observations. This is to test the channel based
    		// synchronization used internally.
    		select {
    		case <-ticker.C:
    			ttfbHist.With(prometheus.Labels{"api": obs.label}).Observe(obs.val)
    		}
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Mar 04 18:05:56 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  8. internal/dsync/drwmutex.go

    			}
    		}
    	}
    }
    
    func (dm *DRWMutex) startContinuousLockRefresh(lockLossCallback func(), id, source string, quorum int) {
    	ctx, cancel := context.WithCancel(context.Background())
    
    	dm.m.Lock()
    	dm.cancelRefresh = cancel
    	dm.m.Unlock()
    
    	go func() {
    		defer cancel()
    
    		refreshTimer := time.NewTimer(dm.refreshInterval)
    		defer refreshTimer.Stop()
    
    		for {
    			select {
    			case <-ctx.Done():
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  9. cmd/metacache-set.go

    	metaMu := &mc.mu
    	rpc := mc.rpc
    	cancel := mc.cancel
    	defer func() {
    		o.debugln(color.Green("saveMetaCacheStream:")+"err:", err)
    		if err != nil && !errors.Is(err, io.EOF) {
    			go mc.setErr(err.Error())
    			cancel()
    		}
    	}()
    
    	defer cancel()
    	// Save continuous updates
    	go func() {
    		var err error
    		ticker := time.NewTicker(10 * time.Second)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 19:52:52 GMT 2024
    - 30.4K bytes
    - Viewed (0)
  10. internal/event/target/redis.go

    			}
    			return err
    		}
    		target.firstPing = true
    	}
    
    	eventData, eErr := target.store.Get(key.Name)
    	if eErr != nil {
    		// The last event key in a successful batch will be sent in the channel atmost once by the replayEvents()
    		// Such events will not exist and would've been already been sent successfully.
    		if os.IsNotExist(eErr) {
    			return nil
    		}
    		return eErr
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Mar 19 04:37:54 GMT 2024
    - 9.1K bytes
    - Viewed (0)
Back to top