Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for resultChan (0.2 sec)

  1. staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher.go

    	// It's fine to double cancel.
    	wc.cancel()
    
    	// we need to wait until resultChan wouldn't be used anymore
    	resultChanWG.Wait()
    	close(wc.resultChan)
    }
    
    func (wc *watchChan) Stop() {
    	wc.cancel()
    }
    
    func (wc *watchChan) ResultChan() <-chan watch.Event {
    	return wc.resultChan
    }
    
    func (wc *watchChan) RequestWatchProgress() error {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 25 10:26:38 UTC 2023
    - 18.9K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/storage/testing/utils.go

    	case e, ok := <-w.ResultChan():
    		if ok {
    			var obj string
    			switch e.Object.(type) {
    			case *example.Pod:
    				obj = e.Object.(*example.Pod).Name
    			case *v1.Status:
    				obj = e.Object.(*v1.Status).Message
    			}
    			t.Errorf("ResultChan should have been closed. Event: %s. Object: %s", e.Type, obj)
    		}
    	case <-time.After(wait.ForeverTestTimeout):
    		t.Errorf("time out after waiting 1s on ResultChan")
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 22 07:26:55 UTC 2024
    - 10.3K bytes
    - Viewed (1)
  3. staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go

    	w := store.watcher.createWatchChan(ctx, "/abc", 0, false, false, storage.Everything)
    	// make resultChan and errChan blocking to ensure ordering.
    	w.resultChan = make(chan watch.Event)
    	w.errChan = make(chan error)
    	// The event flow goes like:
    	// - first we send an error, it should block on resultChan.
    	// - Then we cancel ctx. The blocking on resultChan should be freed up
    	//   and run() goroutine should return.
    	var wg sync.WaitGroup
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 12.3K bytes
    - Viewed (1)
  4. cni/pkg/install/cniconfig_test.go

    			defer cancel()
    			resultChan, errChan := make(chan string, 1), make(chan error, 1)
    			go func(resultChan chan string, errChan chan error, ctx context.Context, cniConfName, mountedCNINetDir string, chained bool) {
    				result, err := getCNIConfigFilepath(ctx, cniConfName, mountedCNINetDir, chained)
    				if err != nil {
    					errChan <- err
    					return
    				}
    				resultChan <- result
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 21 18:32:01 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/storage/cacher/cache_watcher_test.go

    	}()
    
    	// We expect all init events to be delivered.
    	for i := 0; i < numObjects; i++ {
    		<-w.ResultChan()
    	}
    	// We don't expect any other event to be delivered and thus
    	// the ResultChan to be closed.
    	result, ok := <-w.ResultChan()
    	if ok {
    		t.Errorf("unexpected event: %#v", result)
    	}
    
    	wg.Wait()
    }
    
    func TestTimeBucketWatchersBasic(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 09:20:10 UTC 2024
    - 22.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiextensions-apiserver/test/integration/basic_test.go

    			t.Errorf("expected %v, got %v", e, a)
    		}
    		for watchVersion, noxuWatch := range noxuWatchs {
    			select {
    			case watchEvent := <-noxuWatch.ResultChan():
    				if e, a := watch.Added, watchEvent.Type; e != a {
    					t.Errorf("expected %v, got %v", e, a)
    					break
    				}
    				createdObjectMeta, err := meta.Accessor(watchEvent.Object)
    				if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 11:35:33 UTC 2024
    - 33.4K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/watch.go

    	w.WriteHeader(http.StatusOK)
    	flusher.Flush()
    
    	kind := s.Scope.Kind
    	watchEncoder := newWatchEncoder(req.Context(), kind, s.EmbeddedEncoder, s.Encoder, framer)
    	ch := s.Watching.ResultChan()
    	done := req.Context().Done()
    
    	for {
    		select {
    		case <-s.ServerShuttingDownCh:
    			// the server has signaled that it is shutting down (not accepting
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Dec 14 16:37:25 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiextensions-apiserver/test/integration/registration_test.go

    		if err != nil {
    			t.Fatalf("unable to create Noxu Instance %q:%v", key, err)
    		}
    	}
    
    	addEvents := 0
    	for addEvents < len(instances) {
    		select {
    		case watchEvent := <-noxuNamespacedWatch.ResultChan():
    			if e, a := watch.Added, watchEvent.Type; e != a {
    				t.Fatalf("expected %v, got %v", e, a)
    			}
    			name, err := meta.NewAccessor().Name(watchEvent.Object)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 14 11:58:05 UTC 2022
    - 15.4K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/endpoints/watch_test.go

    	// Send/receive should still work
    	for _, item := range watchTestTable {
    		try(item.t, item.obj)
    	}
    
    	// Client requests a close
    	ws.Close()
    
    	select {
    	case data, ok := <-simpleStorage.fakeWatch.ResultChan():
    		if ok {
    			t.Errorf("expected a closed result channel, but got watch result %#v", data)
    		}
    	case <-time.After(5 * time.Second):
    		t.Errorf("watcher did not close when client closed")
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Nov 30 17:27:39 UTC 2023
    - 30K bytes
    - Viewed (0)
  10. istioctl/pkg/wait/wait.go

    			default:
    				continue
    			}
    		}
    
    		return nil
    	})
    	return g
    }
    
    type watcher struct {
    	resultsChan chan string
    	errorChan   chan error
    	ctx         context.Context
    }
    
    func withContext(ctx context.Context) *watcher {
    	return &watcher{
    		resultsChan: make(chan string, 1),
    		errorChan:   make(chan error, 1),
    		ctx:         ctx,
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Feb 17 12:24:17 UTC 2024
    - 10.1K bytes
    - Viewed (1)
Back to top