- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 15 for resultChan (0.15 sec)
-
staging/src/k8s.io/apimachinery/pkg/watch/watch.go
// must always be called, even if the consumer has not yet called // ResultChan(). // // Only the consumer should call Stop(), not the producer. If the producer // errors and needs to stop the watch prematurely, it should instead send // an error event and close the result channel. Stop() // ResultChan returns a channel which will receive events from the event
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jun 12 20:06:22 UTC 2024 - 8.1K bytes - Viewed (1) -
staging/src/k8s.io/apimachinery/pkg/watch/streamwatcher_test.go
fr := &fakeReporter{} sw := NewStreamWatcher(fd, fr) evt, ok := <-sw.ResultChan() if !ok { t.Fatalf("unexpected close") } if evt.Type != Error || evt.Object != runtime.Unstructured(nil) { t.Fatalf("unexpected object: %#v", evt) } _, ok = <-sw.ResultChan() if ok { t.Fatalf("unexpected open channel") } sw.Stop() _, ok = <-sw.ResultChan() if ok { t.Fatalf("unexpected open channel") } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Mar 06 13:42:59 UTC 2021 - 2.5K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/watch/watch_test.go
for _, expect := range table { got, ok := <-w.ResultChan() if !ok { t.Fatalf("closed early") } if e, a := expect.t, got.Type; e != a { t.Fatalf("Expected %v, got %v", e, a) } if a, ok := got.Object.(testType); !ok || a != expect.s { t.Fatalf("Expected %v, got %v", expect.s, a) } } _, stillOpen := <-w.ResultChan() if stillOpen { t.Fatal("Never stopped") } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Aug 15 11:34:31 UTC 2018 - 3.7K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher.go
func (d *decoratedWatcher) run(ctx context.Context) { var recv, send watch.Event var ok bool defer close(d.resultCh) for { select { case recv, ok = <-d.w.ResultChan(): if !ok { // The underlying channel was closed, cancel our context d.cancel() return } switch recv.Type { case watch.Added, watch.Modified, watch.Deleted, watch.Bookmark:
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jun 02 19:25:31 UTC 2021 - 2.3K bytes - Viewed (1) -
staging/src/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher_test.go
expectPodEvent(t, dw, watch.Deleted) // cancel the passed-in context to simulate request timeout cancel() // expect the decorated channel to be closed select { case e, ok := <-dw.ResultChan(): if ok { t.Errorf("expected result chan closed, got %#v", e) } case <-time.After(wait.ForeverTestTimeout): t.Errorf("timeout after %v", wait.ForeverTestTimeout) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jun 02 19:25:31 UTC 2021 - 3.4K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/watch/mux_test.go
} w2, err := m.Watch() if err != nil { t.Fatalf("Unable start event watcher: '%v' (will not retry!)", err) } w.Stop() m.Shutdown() if _, open := <-w.ResultChan(); open { t.Errorf("Stop didn't work?") } if _, open := <-w2.ResultChan(); open { t.Errorf("Shutdown didn't work?") } // Extra stops don't hurt things w.Stop() w2.Stop() }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon May 16 15:26:25 UTC 2022 - 8K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/watch/filter_test.go
}) go func() { for _, item := range table { source.Action(item.Type, item.Object) } source.Stop() }() var got []string for { event, ok := <-filtered.ResultChan() if !ok { break } got = append(got, string(event.Object.(testType))) } if e, a := []string{"foo", "qux", "zoo"}, got; !reflect.DeepEqual(e, a) { t.Errorf("got %v, wanted %v", e, a) } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Nov 16 11:56:41 UTC 2021 - 2.5K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/watch/filter.go
f: f, } go fw.loop() return fw } type filteredWatch struct { incoming Interface result chan Event f FilterFunc } // ResultChan returns a channel which will receive filtered events. func (fw *filteredWatch) ResultChan() <-chan Event { return fw.result } // Stop stops the upstream watch, which will eventually stop this watch. func (fw *filteredWatch) Stop() { fw.incoming.Stop() }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jul 26 17:14:05 UTC 2022 - 2.8K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/watch/streamwatcher.go
// error reporting might block forever. // Therefore a dedicated stop channel is used to resolve this blocking. done: make(chan struct{}), } go sw.receive() return sw } // ResultChan implements Interface. func (sw *StreamWatcher) ResultChan() <-chan Event { return sw.result } // Stop implements Interface. func (sw *StreamWatcher) Stop() { // Call Close() exactly once by locking and setting a flag. sw.Lock()
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Mar 06 13:42:59 UTC 2021 - 3.9K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/watch/mux.go
type broadcasterWatcher struct { result chan Event stopped chan struct{} stop sync.Once id int64 m *Broadcaster } // ResultChan returns a channel to use for waiting on events. func (mw *broadcasterWatcher) ResultChan() <-chan Event { return mw.result } // Stop stops watching and removes mw from its list. // It will block until the watcher stop request is actually executed
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon May 16 15:26:36 UTC 2022 - 9.4K bytes - Viewed (0)