- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 268 for cancel0 (0.33 sec)
-
src/context/afterfunc_test.go
ctx0 := &afterFuncContext{} ctx1, cancel := context.WithTimeout(ctx0, veryLongDuration) defer cancel() ctx0.cancel(context.Canceled) <-ctx1.Done() } func TestCustomContextAfterFuncAfterFunc(t *testing.T) { ctx0 := &afterFuncContext{} donec := make(chan struct{}) stop := context.AfterFunc(ctx0, func() { close(donec) }) defer stop() ctx0.cancel(context.Canceled) <-donec }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 18 16:58:52 UTC 2023 - 3.4K bytes - Viewed (0) -
src/context/example_test.go
defer cancel1(errors.New("ctx1 canceled")) ctx2, cancel2 := context.WithCancelCause(context.Background()) mergedCtx, mergedCancel := mergeCancel(ctx1, ctx2) defer mergedCancel() cancel2(errors.New("ctx2 canceled")) <-mergedCtx.Done() fmt.Println(context.Cause(mergedCtx)) // Output: // ctx2 canceled
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 21 20:24:28 UTC 2023 - 6.7K bytes - Viewed (0) -
platforms/core-runtime/daemon-protocol/src/main/java/org/gradle/launcher/daemon/protocol/Cancel.java
* See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.launcher.daemon.protocol; public class Cancel extends Message {
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu May 09 04:50:46 UTC 2024 - 702 bytes - Viewed (0) -
src/database/sql/example_service_test.go
// This is a long SELECT. Use the request context as the base of // the context timeout, but give it some time to finish. If // the client cancels before the query is done the query will also // be canceled. ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second) defer cancel() var names []string rows, err := db.QueryContext(ctx, "select p.name from people as p where p.active = true;") if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Feb 28 20:21:26 UTC 2024 - 4K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sync/errgroup/errgroup.go
// // The derived Context is canceled the first time a function passed to 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
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:57:25 UTC 2024 - 3.3K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/Call.kt
* exception. * * @throws IllegalStateException when the call has already been executed. */ fun enqueue(responseCallback: Callback) /** Cancels the request, if possible. Requests that are already complete cannot be canceled. */ fun cancel() /** * Returns true if this call has been either [executed][execute] or [enqueued][enqueue]. It is an * error to execute a call more than once. */
Registered: Sun Jun 16 04:42:17 UTC 2024 - Last Modified: Wed Dec 20 23:27:07 UTC 2023 - 3.6K bytes - Viewed (0) -
internal/grid/stream.go
// Results returns the results from the remote server one by one. // If any error is returned by the callback, the stream will be canceled. // If the context is canceled, the stream will be canceled. func (s *Stream) Results(next func(b []byte) error) (err error) { done := false defer func() { if s.cancel != nil { s.cancel(err) } if !done { // Drain channel. for range s.responses { } } }()
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Fri Jun 07 15:51:52 UTC 2024 - 3.1K bytes - Viewed (0) -
internal/cachevalue/cache_test.go
return time.Now(), slowCaller(ctx) }, ) ctx, cancel := context.WithCancel(context.Background()) cancel() // cancel context to test. _, err := cache.GetWithCtx(ctx) if !errors.Is(err, context.Canceled) { t.Fatalf("expected context.Canceled err, got %v", err) } ctx, cancel = context.WithCancel(context.Background()) defer cancel() t1, err := cache.GetWithCtx(ctx) if err != nil {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Thu May 09 00:51:34 UTC 2024 - 2.7K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/FakeRoutePlanner.kt
connectState = ConnectState.TLS_CONNECTED ConnectResult(this) } } } override fun handleSuccess() = connection override fun cancel() { events += "plan $id cancel" canceled = true } override fun retry(): FakePlan? { check(!retryTaken) retryTaken = true return retry } } enum class ConnectState {
Registered: Sun Jun 16 04:42:17 UTC 2024 - Last Modified: Wed Apr 24 04:40:49 UTC 2024 - 6.2K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/http2/Http2ExchangeCodec.kt
stream = http2Connection.newStream(requestHeaders, hasRequestBody) // We may have been asked to cancel while creating the new stream and sending the request // headers, but there was still no stream to close. if (canceled) { stream!!.closeLater(ErrorCode.CANCEL) throw IOException("Canceled") } stream!!.readTimeout().timeout(chain.readTimeoutMillis.toLong(), TimeUnit.MILLISECONDS)
Registered: Sun Jun 16 04:42:17 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 6.9K bytes - Viewed (0)