Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 123 for cancel (0.16 sec)

  1. guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java

        assertFailed(future, cause);
      }
    
      public void testCanceled() throws Exception {
        assertThat(future.cancel(false /* mayInterruptIfRunning */)).isTrue();
        assertCancelled(future, false);
      }
    
      public void testInterrupted() throws Exception {
        assertThat(future.cancel(true /* mayInterruptIfRunning */)).isTrue();
        assertCancelled(future, true);
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 15.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java

        assertFailed(future, cause);
      }
    
      public void testCanceled() throws Exception {
        assertThat(future.cancel(false /* mayInterruptIfRunning */)).isTrue();
        assertCancelled(future, false);
      }
    
      public void testInterrupted() throws Exception {
        assertThat(future.cancel(true /* mayInterruptIfRunning */)).isTrue();
        assertCancelled(future, true);
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 15.5K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

        inputFuture.cancel(true); // argument is ignored
        assertThrows(CancellationException.class, () -> resultFuture.get());
      }
    
      public void testFutureGetThrowsCancellationIfOutputCancelled() throws Exception {
        inputFuture.set(SLOW_OUTPUT_VALID_INPUT_DATA);
        outputFuture.cancel(true); // argument is ignored
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java

        async.setFuture(inner);
        async.cancel(false);
        assertTrue(inner.isCancelled());
        assertFalse(inner.wasInterrupted());
        assertThrows(CancellationException.class, () -> inner.get());
      }
    
      public void testCancel_beforeSet() throws Exception {
        SettableFuture<Object> async = SettableFuture.create();
        async.cancel(true);
        assertFalse(async.set(42));
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.3K bytes
    - Viewed (1)
  5. android/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java

        async.setFuture(inner);
        async.cancel(false);
        assertTrue(inner.isCancelled());
        assertFalse(inner.wasInterrupted());
        assertThrows(CancellationException.class, () -> inner.get());
      }
    
      public void testCancel_beforeSet() throws Exception {
        SettableFuture<Object> async = SettableFuture.create();
        async.cancel(true);
        assertFalse(async.set(42));
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java

              : getUninterruptibly(future, timeoutDuration, timeoutUnit);
        } catch (InterruptedException e) {
          future.cancel(true);
          throw e;
        } catch (ExecutionException e) {
          throw throwCause(e, true /* combineStackTraces */);
        } catch (TimeoutException e) {
          future.cancel(true);
          throw new UncheckedTimeoutException(e);
        }
      }
    
      @CanIgnoreReturnValue
      @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jun 27 14:21:11 GMT 2023
    - 9.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

        inputFuture.cancel(true); // argument is ignored
        assertThrows(CancellationException.class, () -> resultFuture.get());
      }
    
      public void testFutureGetThrowsCancellationIfOutputCancelled() throws Exception {
        inputFuture.set(SLOW_OUTPUT_VALID_INPUT_DATA);
        outputFuture.cancel(true); // argument is ignored
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.1K bytes
    - Viewed (0)
  8. 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 Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java

      }
    
      public void testListenerCalledOnCancelFromRunning() throws Exception {
        exec.execute(task);
        runLatch.await();
    
        // Task has started up, cancel it while it's running.
        task.cancel(true);
        assertTrue(task.isDone());
        assertTrue(task.isCancelled());
        assertEquals(1, taskLatch.getCount());
    
        // Wait for the listeners to be called.
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/FuturesTest.java

      }
    
      private static void doTestSuccessfulAsList_resultCancelledRacingInputDone() throws Exception {
        // Simple (combined.cancel -> input.cancel -> setOneValue):
        successfulAsList(ImmutableList.of(SettableFuture.create())).cancel(true);
    
        /*
         * Complex (combined.cancel -> input.cancel -> other.set -> setOneValue),
         * to show that this isn't just about problems with the input future we just
         * cancelled:
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 144.5K bytes
    - Viewed (0)
Back to top