Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewStreamWatcher (0.43 sec)

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

    	return runtime.Unstructured(nil)
    }
    
    func TestStreamWatcher(t *testing.T) {
    	table := []Event{
    		{Type: Added, Object: testType("foo")},
    	}
    
    	fd := fakeDecoder{items: make(chan Event, 5)}
    	sw := NewStreamWatcher(fd, nil)
    
    	for _, item := range table {
    		fd.items <- item
    		got, open := <-sw.ResultChan()
    		if !open {
    			t.Errorf("unexpected early close")
    		}
    		if e, a := item, got; !reflect.DeepEqual(e, a) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Mar 06 13:42:59 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/watch/streamwatcher.go

    // into a watch.Interface.
    type StreamWatcher struct {
    	sync.Mutex
    	source   Decoder
    	reporter Reporter
    	result   chan Event
    	done     chan struct{}
    }
    
    // NewStreamWatcher creates a StreamWatcher from the given decoder.
    func NewStreamWatcher(d Decoder, r Reporter) *StreamWatcher {
    	sw := &StreamWatcher{
    		source:   d,
    		reporter: r,
    		// It's easy for a consumer to add buffering via an extra
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Mar 06 13:42:59 UTC 2021
    - 3.9K bytes
    - Viewed (0)
Back to top