Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 166 for doDecl (0.11 sec)

  1. internal/pubsub/pubsub.go

    		enc := json.NewEncoder(&buf)
    		for {
    			select {
    			case <-doneCh:
    				return
    			case v, ok := <-subChT:
    				if !ok {
    					return
    				}
    				buf.Reset()
    				err := enc.Encode(v)
    				if err != nil {
    					return
    				}
    
    				select {
    				case subCh <- append(GetByteBuffer()[:0], buf.Bytes()...):
    					continue
    				case <-doneCh:
    					return
    				}
    			}
    		}
    	}()
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Feb 06 16:57:30 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  2. test/stress/runstress.go

    			<-gate
    		}()
    	}
    }
    
    func ringf(in <-chan int, out chan<- int, donec chan bool) {
    	for {
    		var n int
    		select {
    		case <-donec:
    			return
    		case n = <-in:
    		}
    		if n == 0 {
    			close(donec)
    			return
    		}
    		out <- n - 1
    	}
    }
    
    func threadRing(bufsize int) {
    	const N = 100
    	donec := make(chan bool)
    	one := make(chan int, bufsize) // will be input to thread 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/testing/promise/counting_test.go

    	os.Exit(m.Run())
    }
    
    func TestCountingWriteOnceSet(t *testing.T) {
    	oldTime := time.Now()
    	cval := &oldTime
    	doneCh := make(chan struct{})
    	now := time.Now()
    	clock, counter := testeventclock.NewFake(now, 0, nil)
    	var lock sync.Mutex
    	wr := NewCountingWriteOnce(counter, &lock, nil, doneCh, cval)
    	gots := make(chan interface{}, 1)
    	goGetExpectNotYet(t, clock, counter, wr, gots, "Set")
    	aval := &now
    	func() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 10 14:37:53 UTC 2021
    - 4.6K bytes
    - Viewed (0)
  4. src/runtime/semasleep_test.go

    	}
    	beforeStart := time.Now()
    	if err := cmd.Start(); err != nil {
    		t.Fatalf("Failed to start command: %v", err)
    	}
    
    	waiting := false
    	doneCh := make(chan error, 1)
    	t.Cleanup(func() {
    		cmd.Process.Kill()
    		if waiting {
    			<-doneCh
    		} else {
    			cmd.Wait()
    		}
    	})
    
    	// Wait for After1 to close its stdout so that we know the runtime's SIGIO
    	// handler is registered.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 06 17:48:24 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  5. internal/s3select/message.go

    func (writer *messageWriter) Finish(bytesScanned, bytesProcessed int64) error {
    	select {
    	case <-writer.doneCh:
    		return fmt.Errorf("messageWriter is done")
    	default:
    		writer.finBytesScanned = bytesScanned
    		writer.finBytesProcessed = bytesProcessed
    		close(writer.payloadCh)
    		// Wait until the `start` go-routine is done.
    		<-writer.doneCh
    		return nil
    	}
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Aug 30 15:26:43 UTC 2022
    - 15.2K bytes
    - Viewed (0)
  6. internal/grid/stream.go

    		}
    
    		if !done {
    			// Drain channel.
    			for range s.responses {
    			}
    		}
    	}()
    	doneCh := s.ctx.Done()
    	for {
    		select {
    		case <-doneCh:
    			if err := context.Cause(s.ctx); !errors.Is(err, errStreamEOF) {
    				return err
    			}
    			// Fall through to be sure we have returned all responses.
    			doneCh = nil
    		case resp, ok := <-s.responses:
    			if !ok {
    				done = true
    				return nil
    			}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jun 07 15:51:52 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  7. pkg/config/mesh/networks_watcher_test.go

    	g.Expect(w.Networks()).To(Equal(&n))
    
    	doneCh := make(chan struct{}, 1)
    
    	var newN *meshconfig.MeshNetworks
    	w.AddNetworksHandler(func() {
    		newN = w.Networks()
    		close(doneCh)
    	})
    
    	// Change the file to trigger the update.
    	n.Networks["test"] = &meshconfig.Network{}
    	writeMessage(t, path, &n)
    
    	select {
    	case <-doneCh:
    		g.Expect(newN).To(Equal(&n))
    		g.Expect(w.Networks()).To(Equal(newN))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  8. pkg/config/mesh/watcher_test.go

    	w := newWatcher(t, path, multi)
    	assert.Equal(t, w.Mesh(), m)
    
    	doneCh := make(chan struct{}, 1)
    
    	var newM *meshconfig.MeshConfig
    	w.AddMeshHandler(func() {
    		newM = w.Mesh()
    		close(doneCh)
    	})
    
    	// Change the file to trigger the update.
    	m.IngressClass = "foo"
    	writeMessage(t, path, m)
    
    	select {
    	case <-doneCh:
    		assert.Equal(t, newM, m)
    		assert.Equal(t, w.Mesh(), newM)
    		break
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 3K bytes
    - Viewed (0)
  9. src/context/x_test.go

    type customDoneContext struct {
    	Context
    	donec chan struct{}
    }
    
    func (c *customDoneContext) Done() <-chan struct{} {
    	return c.donec
    }
    
    func TestCustomContextPropagation(t *testing.T) {
    	cause := errors.New("TestCustomContextPropagation")
    	donec := make(chan struct{})
    	ctx1, cancel1 := WithCancelCause(Background())
    	ctx2 := &customDoneContext{
    		Context: ctx1,
    		donec:   donec,
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  10. cmd/storage-rest-server.go

    				}
    				return
    			}
    		}
    	}()
    	return func(err error) {
    		if doneCh == nil {
    			return
    		}
    
    		// Indicate we are ready to write.
    		doneCh <- err
    
    		// Wait for channel to be closed so we don't race on writes.
    		<-doneCh
    
    		// Clear so we can be called multiple times without crashing.
    		doneCh = nil
    	}, &closeNotifier{rc: r.Body, done: bodyDoneCh}
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 10 15:51:27 UTC 2024
    - 44.8K bytes
    - Viewed (0)
Back to top