Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for cancelFn (0.54 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/CancelCall.java

        final long startNanos = System.nanoTime();
        final Call call = client.newCall(request);
    
        // Schedule a job to cancel the call in 1 second.
        executor.schedule(() -> {
          System.out.printf("%.2f Canceling call.%n", (System.nanoTime() - startNanos) / 1e9f);
          call.cancel();
          System.out.printf("%.2f Canceled call.%n", (System.nanoTime() - startNanos) / 1e9f);
        }, 1, TimeUnit.SECONDS);
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java

          printEvent("callEnd");
        }
    
        @Override public void callFailed(Call call, IOException ioe) {
          printEvent("callFailed");
        }
    
        @Override public void canceled(Call call) {
          printEvent("canceled");
        }
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 16 23:20:49 GMT 2020
    - 6.1K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

          printEvent("callEnd");
        }
    
        @Override public void callFailed(Call call, IOException ioe) {
          printEvent("callFailed");
        }
    
        @Override public void canceled(Call call) {
          printEvent("canceled");
        }
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 16 23:20:49 GMT 2020
    - 5.3K bytes
    - Viewed (0)
Back to top