Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 2,505 for ONCE (0.04 sec)

  1. src/internal/lazytemplate/lazytemplate.go

    // template will be parsed the first time it is needed.
    type Template struct {
    	name, text string
    
    	once sync.Once
    	tmpl *template.Template
    }
    
    func (r *Template) tp() *template.Template {
    	r.once.Do(r.build)
    	return r.tmpl
    }
    
    func (r *Template) build() {
    	r.tmpl = template.Must(template.New(r.name).Parse(r.text))
    	r.name, r.text = "", ""
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.3K bytes
    - Viewed (0)
  2. internal/cachevalue/cache.go

    	// The returned value can no longer be modified once returned.
    	// Should be set before calling Get().
    	updateFn func(ctx context.Context) (T, error)
    
    	// ttl for a cached value.
    	ttl time.Duration
    
    	opts Opts
    
    	// Once can be used to initialize values for lazy initialization.
    	// Should be set before calling Get().
    	Once sync.Once
    
    	// Managed values.
    	val          atomic.Pointer[T]
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 12:50:46 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  3. subprojects/core/src/test/groovy/org/gradle/deployment/internal/DefaultDeploymentRegistryTest.groovy

            when:
            registry.get("id", TestDeploymentHandle)
            then:
            def e = thrown(IllegalStateException)
            e.message == "Cannot modify deployment handles once the registry has been stopped."
        }
    
        def "cannot register a handle once the registry is stopped" () {
            given:
            registry.stop()
    
            when:
            registry.start("id", DeploymentRegistry.ChangeBehavior.NONE, TestDeploymentHandle)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Mar 08 13:46:07 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/wait/loop.go

    	var timeCh <-chan time.Time
    	doneCh := ctx.Done()
    
    	if !sliding {
    		timeCh = t.C()
    	}
    
    	// if immediate is true the condition is
    	// guaranteed to be executed at least once,
    	// if we haven't requested immediate execution, delay once
    	if immediate {
    		if ok, err := func() (bool, error) {
    			defer runtime.HandleCrash()
    			return condition(ctx)
    		}(); err != nil || ok {
    			return err
    		}
    	}
    
    	if sliding {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:47:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  5. internal/ioutil/wait_pipe.go

    	"sync"
    )
    
    // PipeWriter is similar to io.PipeWriter with wait group
    type PipeWriter struct {
    	*io.PipeWriter
    	once sync.Once
    	done func()
    }
    
    // CloseWithError close with supplied error the writer end.
    func (w *PipeWriter) CloseWithError(err error) error {
    	err = w.PipeWriter.CloseWithError(err)
    	w.once.Do(func() {
    		w.done()
    	})
    	return err
    }
    
    // PipeReader is similar to io.PipeReader with wait group
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 27 14:55:36 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  6. src/runtime/os_solaris.go

    	gp := getg()
    	var mp *m
    	if gp != nil {
    		mp = gp.m
    	}
    	if mp != nil && mp.libcallsp == 0 {
    		mp.libcallg.set(gp)
    		mp.libcallpc = getcallerpc()
    		// sp must be the last, because once async cpu profiler finds
    		// all three values to be non-zero, it will use them
    		mp.libcallsp = getcallersp()
    	} else {
    		mp = nil // See comment in sys_darwin.go:libcCall
    	}
    
    	var libcall libcall
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 06 18:49:01 UTC 2023
    - 6.6K bytes
    - Viewed (0)
  7. pkg/controller/certificates/rootcacertpublisher/metrics.go

    		code = strconv.Itoa(int(se.Status().Code))
    	}
    	syncLatency.WithLabelValues(code).Observe(time.Since(start).Seconds())
    	syncCounter.WithLabelValues(code).Inc()
    }
    
    var once sync.Once
    
    func registerMetrics() {
    	once.Do(func() {
    		legacyregistry.MustRegister(syncCounter)
    		legacyregistry.MustRegister(syncLatency)
    	})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Sep 16 12:05:32 UTC 2021
    - 2K bytes
    - Viewed (0)
  8. src/cmd/go/internal/vcweb/git.go

    	"os/exec"
    	"runtime"
    	"slices"
    	"sync"
    )
    
    type gitHandler struct {
    	once       sync.Once
    	gitPath    string
    	gitPathErr error
    }
    
    func (h *gitHandler) Available() bool {
    	if runtime.GOOS == "plan9" {
    		// The Git command is usually not the real Git on Plan 9.
    		// See https://golang.org/issues/29640.
    		return false
    	}
    	h.once.Do(func() {
    		h.gitPath, h.gitPathErr = exec.LookPath("git")
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 14 19:46:23 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  9. src/cmd/go/internal/toolchain/path_windows.go

    package toolchain
    
    import (
    	"io/fs"
    	"os"
    	"path/filepath"
    	"strings"
    	"sync"
    
    	"cmd/go/internal/gover"
    )
    
    // pathExts is a cached PATHEXT list.
    var pathExts struct {
    	once sync.Once
    	list []string
    }
    
    func initPathExts() {
    	var exts []string
    	x := os.Getenv(`PATHEXT`)
    	if x != "" {
    		for _, e := range strings.Split(strings.ToLower(x), `;`) {
    			if e == "" {
    				continue
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 31 15:15:19 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go

    )
    
    // Regexp is a wrapper around [regexp.Regexp], where the underlying regexp will be
    // compiled the first time it is needed.
    type Regexp struct {
    	str  string
    	once sync.Once
    	rx   *regexp.Regexp
    }
    
    func (r *Regexp) re() *regexp.Regexp {
    	r.once.Do(r.build)
    	return r.rx
    }
    
    func (r *Regexp) build() {
    	r.rx = regexp.MustCompile(r.str)
    	r.str = ""
    }
    
    func (r *Regexp) FindSubmatch(s []byte) [][]byte {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 12 20:38:21 UTC 2023
    - 1.8K bytes
    - Viewed (0)
Back to top