- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 17 for withCancelCause (0.2 sec)
-
src/context/x_test.go
err: Canceled, cause: Canceled, }, { name: "WithCancelCause", ctx: func() Context { ctx, cancel := WithCancelCause(Background()) cancel(parentCause) return ctx }, err: Canceled, cause: parentCause, }, { name: "WithCancelCause nil", ctx: func() Context { ctx, cancel := WithCancelCause(Background()) cancel(nil) return ctx },
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 26 19:58:28 UTC 2024 - 26.3K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sync/errgroup/go120.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:57:25 UTC 2024 - 335 bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sync/errgroup/pre_go120.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !go1.20 package errgroup import "context" func withCancelCause(parent context.Context) (context.Context, func(error)) { ctx, cancel := context.WithCancel(parent) return ctx, func(error) { cancel() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:57:25 UTC 2024 - 377 bytes - Viewed (0) -
src/context/context.go
type CancelCauseFunc func(cause error) // WithCancelCause behaves like [WithCancel] but returns a [CancelCauseFunc] instead of a [CancelFunc]. // Calling cancel with a non-nil error (the "cause") records that error in ctx; // it can then be retrieved using Cause(ctx). // Calling cancel with nil sets the cause to Canceled. // // Example use: // // ctx, cancel := context.WithCancelCause(parent) // cancel(myError)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 26 19:58:28 UTC 2024 - 23.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sync/errgroup/errgroup.go
// returns a non-nil error or the first time Wait returns, whichever occurs // first. func WithContext(ctx context.Context) (*Group, context.Context) { ctx, cancel := withCancelCause(ctx) return &Group{cancel: cancel}, ctx } // Wait blocks until all function calls from the Go method have returned, then // returns the first non-nil error (if any) from them. func (g *Group) Wait() error {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:57:25 UTC 2024 - 3.3K bytes - Viewed (0) -
src/net/http/transport_internal_test.go
if err != nil { t.Error(err) return } connc <- c }() tr := new(Transport) req, _ := NewRequest("GET", "http://"+ln.Addr().String(), nil) req = req.WithT(t) ctx, cancel := context.WithCancelCause(context.Background()) treq := &transportRequest{Request: req, ctx: ctx, cancel: cancel} cm := connectMethod{targetScheme: "http", targetAddr: ln.Addr().String()} pc, err := tr.getConn(treq, cm) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 15:57:17 UTC 2024 - 6.2K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/server/genericapiserver_graceful_termination_test.go
// the server signals the next steps <-beforeShutdownDelayDurationStep.done() }, nil) // start the API server _, ctx := ktesting.NewTestContext(t) stopCtx, stop := context.WithCancelCause(ctx) defer stop(errors.New("test has completed")) runCompletedCh := make(chan struct{}) go func() { defer close(runCompletedCh) if err := s.PrepareRun().RunWithContext(stopCtx); err != nil {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Apr 29 18:59:21 UTC 2024 - 38.3K bytes - Viewed (0) -
staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testserver.go
// TODO: this is a candidate for using what is now test/utils/ktesting, // should that become a staging repo. ctx, cancel := context.WithCancelCause(context.Background()) var errCh chan error tearDown := func() { // Cancel is stopping apiextensions apiserver and its // delegates, which itself is cleaning up after itself,
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Apr 29 18:59:21 UTC 2024 - 9K bytes - Viewed (1) -
staging/src/k8s.io/apiserver/pkg/server/options/serving_test.go
} for title := range tests { test := tests[title] t.Run(title, func(t *testing.T) { t.Parallel() _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancelCause(ctx) defer cancel(errors.New("test has completed")) // create server cert certDir := "testdata/" + specToName(test.Cert) serverCertBundleFile := filepath.Join(certDir, "cert")
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu May 09 15:52:39 UTC 2024 - 13.8K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/server/config_test.go
} } } } } func TestNewWithDelegate(t *testing.T) { _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancelCause(ctx) defer cancel(errors.New("test is done")) delegateConfig := NewConfig(codecs) delegateConfig.ExternalAddress = "192.168.10.4:443" delegateConfig.PublicAddress = netutils.ParseIPSloppy("192.168.10.4")
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Apr 29 18:59:21 UTC 2024 - 13.1K bytes - Viewed (0)