@Test public void promisePassedToExecutorWillBeCompleted() throws Exception { PrecipicePromise<TimeoutableResult, String> promise = new Eventual<>(1L); when(guardRail.acquirePermits(eq(1L), anyLong())).thenReturn(null); service.complete(TestCallable.success("Same Promise"), promise); assertEquals("Same Promise", promise.future().get()); }
public <T> void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise) { internalComplete(callable, promise); }
ThreadPoolService implements Precipice<TimeoutableResult, Rejected> { public <T> void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise) { internalComplete(callable, promise); } }
ThreadPoolService implements Precipice<TimeoutableResult, Rejected> { public <T> void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise) { internalComplete(callable, promise); } ThreadPoolService(int poolSize, int queueSize, GuardRail<TimeoutableResult, Rejected> guardRail);  ThreadPoolService(ExecutorService executorService, GuardRail<TimeoutableResult, Rejected> guardRail); }
ThreadPoolService implements Precipice<TimeoutableResult, Rejected> { public <T> void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise) { internalComplete(callable, promise); } ThreadPoolService(int poolSize, int queueSize, GuardRail<TimeoutableResult, Rejected> guardRail);  ThreadPoolService(ExecutorService executorService, GuardRail<TimeoutableResult, Rejected> guardRail); @Override GuardRail<TimeoutableResult, Rejected> guardRail(); PrecipiceFuture<TimeoutableResult, T> submit(Callable<T> callable); PrecipiceFuture<TimeoutableResult, T> submit(Callable<T> callable, long millisTimeout); void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise); void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise, long millisTimeout); ExecutorService getExecutor(); DelayQueueTimeoutService getTimeoutService(); void shutdown(); }
ThreadPoolService implements Precipice<TimeoutableResult, Rejected> { public <T> void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise) { internalComplete(callable, promise); } ThreadPoolService(int poolSize, int queueSize, GuardRail<TimeoutableResult, Rejected> guardRail);  ThreadPoolService(ExecutorService executorService, GuardRail<TimeoutableResult, Rejected> guardRail); @Override GuardRail<TimeoutableResult, Rejected> guardRail(); PrecipiceFuture<TimeoutableResult, T> submit(Callable<T> callable); PrecipiceFuture<TimeoutableResult, T> submit(Callable<T> callable, long millisTimeout); void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise); void complete(Callable<T> callable, PrecipicePromise<TimeoutableResult, T> promise, long millisTimeout); ExecutorService getExecutor(); DelayQueueTimeoutService getTimeoutService(); void shutdown();  }