Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for WithContext (0.3 sec)

  1. okhttp-coroutines/src/test/kotlin/okhttp3/SuspendCallTest.kt

    import kotlinx.coroutines.coroutineScope
    import kotlinx.coroutines.job
    import kotlinx.coroutines.supervisorScope
    import kotlinx.coroutines.test.runTest
    import kotlinx.coroutines.withContext
    import kotlinx.coroutines.withTimeout
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.SocketPolicy.DisconnectAfterRequest
    import okhttp3.HttpUrl.Companion.toHttpUrl
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Fri Apr 05 11:25:23 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  2. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

    import kotlinx.coroutines.coroutineScope
    import kotlinx.coroutines.job
    import kotlinx.coroutines.supervisorScope
    import kotlinx.coroutines.test.runTest
    import kotlinx.coroutines.withContext
    import kotlinx.coroutines.withTimeout
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.SocketPolicy.DisconnectAfterRequest
    import okhttp3.Callback
    import okhttp3.FailingCall
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  3. build-logic/binary-compatibility/src/test/groovy/gradlebuild/binarycompatibility/PublicAPIRulesTest.groovy

            given:
            JApiCompatibility jApiType = getProperty(jApiTypeName)
            def incubatingMissingRule = withContext(new IncubatingMissingRule([:]))
            def sinceMissingRule = withContext(new SinceAnnotationMissingRule([:]))
    
            when:
            jApiType.annotations >> [deprecatedAnnotation]
            sourceFile.text = """
                @Deprecated
    Groovy
    - Registered: Wed May 01 11:36:15 GMT 2024
    - Last Modified: Fri Dec 01 20:12:19 GMT 2023
    - 16K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt

      }
    
      private suspend fun updateLocalFile() =
        withContext(Dispatchers.IO) {
          client.newCall(request).executeAsync().use { response ->
            fileSystem.sink(publicSuffixListDotDat).buffer().use { sink ->
              sink.writeAll(response.body.source())
            }
          }
        }
    
      private suspend fun readImportResults(): ImportResults =
        withContext(Dispatchers.IO) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 6K bytes
    - Viewed (0)
  5. internal/event/target/elasticsearch.go

    	resp, err := c.Ping(
    		c.Ping.WithContext(ctx),
    	)
    	if err != nil {
    		return false, store.ErrNotConnected
    	}
    	xhttp.DrainBody(resp.Body)
    	return !resp.IsError(), nil
    }
    
    func (c *esClientV7) entryExists(ctx context.Context, index string, key string) (bool, error) {
    	res, err := c.Exists(
    		index,
    		key,
    		c.Exists.WithContext(ctx),
    	)
    	if err != nil {
    		return false, err
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 15K bytes
    - Viewed (0)
  6. okhttp-coroutines/README.md

    OkHttp Coroutines
    =================
    
    Support for Kotlin clients using coroutines.
    
    ```kotlin
    val call = client.newCall(request)
    
    call.executeAsync().use { response ->
      withContext(Dispatchers.IO) {
        println(response.body?.string())
      }
    }
    ```
    
    This is implemented using `suspendCancellableCoroutine`
    but uses the standard Dispatcher in OkHttp. This means
    that by default Kotlin's Dispatchers are not used.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Nov 09 15:47:27 GMT 2023
    - 609 bytes
    - Viewed (0)
  7. istioctl/pkg/wait/wait.go

    			ctx, cancel := context.WithTimeout(context.Background(), timeout)
    			defer cancel()
    			if generation == "" {
    				w = getAndWatchResource(ctx, cliCtx) // setup version getter from kubernetes
    			} else {
    				w = withContext(ctx)
    				w.Go(func(result chan string) error {
    					result <- generation
    					return nil
    				})
    			}
    			// wait for all deployed versions to be contained in generations
    			t := time.NewTicker(pollInterval)
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Sat Feb 17 12:24:17 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  8. tests/prepared_stmt_test.go

    		t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode")
    	}
    
    	ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
    	defer cancel()
    	txCtx := tx.WithContext(ctx)
    
    	user := *GetUser("prepared_stmt", Config{})
    
    	txCtx.Create(&user)
    
    	var result1 User
    	if err := txCtx.Find(&result1, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  9. tests/scopes_test.go

    	}).Find(&users1)
    
    	if result.RowsAffected != 2 {
    		t.Errorf("Should found two users's name in 1, 2, but got %v", result.RowsAffected)
    	}
    
    	var maxId int64
    	userTable := func(db *gorm.DB) *gorm.DB {
    		return db.WithContext(context.Background()).Table("users")
    	}
    	if err := DB.Scopes(userTable).Select("max(id)").Scan(&maxId).Error; err != nil {
    		t.Errorf("select max(id)")
    	}
    }
    
    func TestComplexScopes(t *testing.T) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  10. cmd/http-tracer.go

    		tc := mcontext.TraceCtxt{
    			AmzReqID:         w.Header().Get(xhttp.AmzRequestID),
    			RequestRecorder:  reqRecorder,
    			ResponseRecorder: respRecorder,
    		}
    
    		r = r.WithContext(context.WithValue(r.Context(), mcontext.ContextTraceKey, &tc))
    
    		reqStartTime := time.Now().UTC()
    		h.ServeHTTP(respRecorder, r)
    		reqEndTime := time.Now().UTC()
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 5.9K bytes
    - Viewed (0)
Back to top