Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for newReady (0.21 sec)

  1. staging/src/k8s.io/apiserver/pkg/storage/cacher/ready_test.go

    limitations under the License.
    */
    
    package cacher
    
    import (
    	"context"
    	"sync"
    	"testing"
    	"time"
    )
    
    func Test_newReady(t *testing.T) {
    	errCh := make(chan error, 10)
    	ready := newReady()
    	ready.set(false)
    	// create 10 goroutines waiting for ready
    	for i := 0; i < 10; i++ {
    		go func() {
    			errCh <- ready.wait(context.Background())
    		}()
    	}
    	select {
    	case <-time.After(1 * time.Second):
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 16 13:32:11 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/storage/cacher/ready.go

    	restartLock sync.Mutex    // protect the transition from ready to pending where the channel is recreated
    	waitCh      chan struct{} // blocks until is ready or stopped
    }
    
    func newReady() *ready {
    	return &ready{
    		waitCh: make(chan struct{}),
    		state:  Pending,
    	}
    }
    
    // done close the channel once the state is Ready or Stopped
    func (r *ready) done() chan struct{} {
    	r.restartLock.Lock()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 16 13:32:11 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go

    			}
    		}
    	}
    
    	if config.Clock == nil {
    		config.Clock = clock.RealClock{}
    	}
    	objType := reflect.TypeOf(obj)
    	cacher := &Cacher{
    		resourcePrefix: config.ResourcePrefix,
    		ready:          newReady(),
    		storage:        config.Storage,
    		objectType:     objType,
    		groupResource:  config.GroupResource,
    		versioner:      config.Versioner,
    		newFunc:        config.NewFunc,
    		newListFunc:    config.NewListFunc,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 10:12:02 UTC 2024
    - 51.8K bytes
    - Viewed (0)
Back to top