Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewProxyWatcher (0.16 sec)

  1. staging/src/k8s.io/apimachinery/pkg/watch/watch.go

    type ProxyWatcher struct {
    	result chan Event
    	stopCh chan struct{}
    
    	mutex   sync.Mutex
    	stopped bool
    }
    
    var _ Interface = &ProxyWatcher{}
    
    // NewProxyWatcher creates new ProxyWatcher by wrapping a channel
    func NewProxyWatcher(ch chan Event) *ProxyWatcher {
    	return &ProxyWatcher{
    		result:  ch,
    		stopCh:  make(chan struct{}),
    		stopped: false,
    	}
    }
    
    // Stop implements Interface
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 20:06:22 UTC 2024
    - 8.1K bytes
    - Viewed (1)
  2. staging/src/k8s.io/apimachinery/pkg/watch/watch_test.go

    		{Modified, testType("qux")},
    		{Modified, testType("bar")},
    		{Deleted, testType("bar")},
    		{Error, testType("error: blah")},
    	}
    
    	ch := make(chan Event, len(events))
    	w := NewProxyWatcher(ch)
    
    	for _, e := range events {
    		ch <- e
    	}
    
    	for _, e := range events {
    		g := <-w.ResultChan()
    		if !reflect.DeepEqual(e, g) {
    			t.Errorf("Expected %#v, got %#v", e, g)
    			continue
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 15 11:34:31 UTC 2018
    - 3.7K bytes
    - Viewed (0)
Back to top