Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,434 for onDone (0.09 sec)

  1. pkg/test/loadbalancersim/network/connection.go

    )
    
    type Connection interface {
    	Name() string
    	Request(onDone func())
    	TotalRequests() uint64
    	ActiveRequests() uint64
    	Latency() *timeseries.Instance
    }
    
    func NewConnection(name string, request func(onDone func())) Connection {
    	return &connection{
    		request: request,
    		helper:  NewConnectionHelper(name),
    	}
    }
    
    type connection struct {
    	request func(onDone func())
    	helper  *ConnectionHelper
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  2. pkg/test/loadbalancersim/network/helper.go

    func (c *ConnectionHelper) Request(request func(onDone func()), onDone func()) {
    	start := time.Now()
    	c.total.Inc()
    	c.active.Inc()
    
    	wrappedDone := func() {
    		// Calculate the latency for this request.
    		latency := time.Since(start)
    
    		// Add the latency observation.
    		c.hist.AddObservation(latency.Seconds(), time.Now())
    
    		c.active.Dec()
    
    		// Invoke the caller's handler.
    		onDone()
    	}
    
    	request(wrappedDone)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  3. pkg/test/loadbalancersim/loadbalancer/leastrequest.go

    	if index2 == index1 {
    		index2 = (index2 + 1) % numConnections
    	}
    
    	return lb.get(index1), lb.get(index2)
    }
    
    func (lb *unweightedLeastRequest) Request(onDone func()) {
    	if len(lb.conns) == 1 {
    		lb.doRequest(lb.get(0), onDone)
    		return
    	}
    
    	// Pick 2 endpoints at random.
    	c1, c2 := lb.pick2()
    
    	// Choose the endpoint with fewer active requests.
    	selected := c1
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 14 20:23:34 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  4. pkg/test/loadbalancersim/mesh/mesh.go

    		Src:  src.Locality(),
    		Dest: dest.Locality(),
    	}]
    
    	request := dest.Request
    	if networkLatency > time.Duration(0) {
    		request = func(onDone func()) {
    			m.networkQ.Schedule(func() {
    				dest.Request(onDone)
    			}, time.Now().Add(networkLatency))
    		}
    	}
    
    	return network.NewConnection(dest.Name(), request)
    }
    
    func (m *Instance) ShutDown() {
    	m.networkQ.ShutDown()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jan 27 20:55:37 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  5. pkg/test/loadbalancersim/loadbalancer/roundrobin.go

    	*weightedConnections
    
    	next      int
    	nextMutex sync.Mutex
    }
    
    func (lb *roundRobin) Request(onDone func()) {
    	// Select the connection to use for this request.
    	lb.nextMutex.Lock()
    	selected := lb.get(lb.next)
    	lb.next = (lb.next + 1) % len(lb.conns)
    	lb.nextMutex.Unlock()
    
    	lb.doRequest(selected, onDone)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  6. pkg/test/loadbalancersim/loadbalancer/weight.go

    		}
    	}
    	return true
    }
    
    func (lb *weightedConnections) get(index int) *WeightedConnection {
    	return lb.conns[index]
    }
    
    func (lb *weightedConnections) doRequest(c *WeightedConnection, onDone func()) {
    	lb.helper.Request(c.Request, onDone)
    }
    
    func (lb *weightedConnections) Name() string {
    	return lb.helper.Name()
    }
    
    func (lb *weightedConnections) TotalRequests() uint64 {
    	return lb.helper.TotalRequests()
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  7. pkg/test/loadbalancersim/mesh/node.go

    func (n *Node) Latency() *timeseries.Instance {
    	return n.helper.Latency()
    }
    
    func (n *Node) Request(onDone func()) {
    	n.helper.Request(func(wrappedOnDone func()) {
    		deadline := time.Now().Add(n.calcRequestDuration())
    
    		// Schedule the done function to be called after the deadline.
    		n.q.Schedule(wrappedOnDone, deadline)
    	}, onDone)
    }
    
    func (n *Node) Locality() locality.Instance {
    	return n.locality
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  8. tensorflow/cc/experimental/libtf/impl/none.h

    namespace libtf {
    namespace impl {
    /// @brief The Singleton `None` class.
    ///
    /// This class is not user-constructible. To create a `None` instance, use
    /// None::GetInstance().
    
    class None final {
     public:
      /// Retrieves the `None` instance.
      ///
      /// @return Returns the `None` singleton.
      static None& GetInstance();
    
      /// Equality operator.
      bool operator==(const None& other) const { return true; }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Aug 03 20:03:31 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  9. licenses/github.com/go-errors/errors/NONE

    John Howard <******@****.***> 1619132365 -0700
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 22 22:59:25 UTC 2021
    - 17 bytes
    - Viewed (0)
  10. licenses/github.com/xeipuuv/gojsonreference/NONE

    John Howard <******@****.***> 1587615255 -0700
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 23 04:14:15 UTC 2020
    - 17 bytes
    - Viewed (0)
Back to top