Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for NewUnbounded (0.18 sec)

  1. pkg/channels/unbounded_test.go

    		}
    	}
    }
    
    // TestSingleWriter starts one reader and one writer goroutine and makes sure
    // that the reader gets all the value added to the buffer by the writer.
    func TestSingleWriter(t *testing.T) {
    	ub := NewUnbounded[int]()
    	reads := []int{}
    
    	var wg sync.WaitGroup
    	wg.Add(1)
    	go func() {
    		defer wg.Done()
    		ch := ub.Get()
    		for i := 0; i < numWriters*numWrites; i++ {
    			r := <-ch
    			reads = append(reads, r)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Aug 31 19:53:39 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  2. pkg/channels/unbounded.go

    // internal/transport/transport.go for an example of this.
    type Unbounded[T any] struct {
    	c       chan T
    	mu      sync.Mutex
    	backlog []T
    }
    
    // NewUnbounded returns a new instance of Unbounded.
    func NewUnbounded[T any]() *Unbounded[T] {
    	return &Unbounded[T]{c: make(chan T, 1)}
    }
    
    // Put adds t to the unbounded buffer.
    // Put will never block
    func (b *Unbounded[T]) Put(t T) {
    	b.mu.Lock()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Aug 31 19:53:39 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  3. pkg/istio-agent/xds_proxy_delta.go

    		conID:             connectionNumber.Inc(),
    		upstreamError:     make(chan error), // can be produced by recv and send
    		downstreamError:   make(chan error), // can be produced by recv and send
    		deltaRequestsChan: channels.NewUnbounded[*discovery.DeltaDiscoveryRequest](),
    		// Allow a buffer of 1. This ensures we queue up at most 2 (one in process, 1 pending) responses before forwarding.
    		deltaResponsesChan: make(chan *discovery.DeltaDiscoveryResponse, 1),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 04 20:29:08 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  4. pkg/istio-agent/xds_proxy.go

    		// unbounded. This is the least likely to cause issues as the messages we store here are the
    		// smallest relative to other channels.
    		requestsChan: channels.NewUnbounded[*discovery.DiscoveryRequest](),
    		// Allow a buffer of 1. This ensures we queue up at most 2 (one in process, 1 pending) responses before forwarding.
    		responsesChan: make(chan *discovery.DiscoveryResponse, 1),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 16 22:12:28 UTC 2024
    - 27.9K bytes
    - Viewed (0)
Back to top