Uses of Interface
com.github.phantomthief.util.ThrowableFunction
-
Packages that use ThrowableFunction Package Description com.github.phantomthief.concurrent com.github.phantomthief.util -
-
Uses of ThrowableFunction in com.github.phantomthief.concurrent
Methods in com.github.phantomthief.concurrent with parameters of type ThrowableFunction Modifier and Type Method Description static <K,V,X extends Throwable>
Map<K,V>MoreFutures. tryWait(Iterable<K> keys, long timeout, TimeUnit unit, ThrowableFunction<K,Future<V>,X> asyncFunc)A typical usage:<pre> // a fail-safe example List<Integer> list = getSomeIds(); Map<Integer, User> success; try { success = tryWait(list, 1, SECONDS, id -> executor.submit(() -> retrieve(id))); } catch (TryWaitUncheckedException e) { success = e.getSuccess(); // there are still some success } // a fail-fast example List<Integer> list = getSomeIds(); // don't try/catch the exception it throws. Map<Integer, User> success = tryWait(list, 1, SECONDS, id -> executor.submit(() -> retrieve(id))); </pre>static <K,V,X extends Throwable>
Map<K,V>MoreFutures. tryWait(Iterable<K> keys, Duration duration, ThrowableFunction<K,Future<V>,X> asyncFunc) -
Uses of ThrowableFunction in com.github.phantomthief.util
Methods in com.github.phantomthief.util that return ThrowableFunction Modifier and Type Method Description default <V> ThrowableFunction<T,V,X>ThrowableFunction. andThen(ThrowableFunction<? super R,? extends V,X> after)default <V> ThrowableFunction<V,R,X>ThrowableFunction. compose(ThrowableFunction<? super V,? extends T,X> before)static <T,X extends Throwable>
ThrowableFunction<T,T,X>ThrowableFunction. identity()Methods in com.github.phantomthief.util with parameters of type ThrowableFunction Modifier and Type Method Description default <V> ThrowableFunction<T,V,X>ThrowableFunction. andThen(ThrowableFunction<? super R,? extends V,X> after)static <T,R>
RMoreFunctions. catching(ThrowableFunction<T,R,Exception> function, T t)static <T,R,X extends Throwable>
RMoreFunctions. catching(ThrowableFunction<T,R,Exception> function, T t, ThrowableConsumer<Throwable,X> exceptionHandler)default <V> ThrowableFunction<V,R,X>ThrowableFunction. compose(ThrowableFunction<? super V,? extends T,X> before)static <T,R>
RMoreFunctions. throwing(ThrowableFunction<T,R,Exception> function, T t)
-