Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for PickAndAdd (0.08 sec)

  1. pkg/test/loadbalancersim/loadbalancer/edf.go

    	heap.Push(e.pq, &Entry{
    		value:    value,
    		weight:   weight,
    		deadline: e.currentDeadline + 1/weight,
    		index:    e.currentIndex,
    	})
    }
    
    // PickAndAdd picks an available entry and re-adds it with the given weight calculation
    func (e *EDF) PickAndAdd(calcWeight func(prevWeight float64, value any) float64) any {
    	// if no available entry, return nil
    	if len(*e.pq) == 0 {
    		return nil
    	}
    	entry := heap.Pop(e.pq).(*Entry)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 19:13:32 UTC 2023
    - 2.8K bytes
    - Viewed (0)
Back to top