T
- Data type stored within the FutureWpublic final class FutureType<T> extends com.aol.cyclops.control.FutureW<T> implements com.aol.cyclops.hkt.alias.Higher<FutureType.µ,T>
Modifier and Type | Class and Description |
---|---|
static class |
FutureType.µ
Witness type
|
com.aol.cyclops.types.applicative.ApplicativeFunctor.Applicatives, com.aol.cyclops.types.applicative.ApplicativeFunctor.ApplyFunctions<T>
Modifier and Type | Method and Description |
---|---|
static <T> FutureType<T> |
empty()
An empty FutureW
|
static <T> FutureType<T> |
fromIterable(java.lang.Iterable<T> iterable)
Construct a FutureW syncrhonously that contains a single value extracted from the supplied Iterable
|
static <T> FutureType<T> |
fromIterable(java.lang.Iterable<T> iterable,
java.util.concurrent.Executor ex)
Construct a FutureW asyncrhonously that contains a single value extracted from the supplied Iterable
|
static <T> FutureType<T> |
fromPublisher(org.reactivestreams.Publisher<T> pub)
Construct a FutureW syncrhonously that contains a single value extracted from the supplied reactive-streams Publisher
|
static <T> FutureType<T> |
fromPublisher(org.reactivestreams.Publisher<T> pub,
java.util.concurrent.Executor ex)
Construct a FutureW asyncrhonously that contains a single value extracted from the supplied reactive-streams Publisher
|
static <T> FutureType<T> |
future()
An empty FutureType
|
com.aol.cyclops.control.FutureW<T> |
narrow() |
static <T> com.aol.cyclops.control.FutureW<T> |
narrow(com.aol.cyclops.hkt.alias.Higher<FutureType.µ,T> futureW)
Convert the HigherKindedType definition for a FutureW into
|
static <T> java.util.concurrent.CompletableFuture<T> |
narrowCompletableFuture(com.aol.cyclops.hkt.alias.Higher<FutureType.µ,T> futureW)
Convert the HigherKindedType definition for a FutureW into
|
static <T> FutureType<T> |
narrowK(com.aol.cyclops.hkt.alias.Higher<FutureType.µ,T> future)
Convert the raw Higher Kinded Type for FutureType types into the FutureType type definition class
|
static <T> FutureType<T> |
of(java.util.concurrent.CompletableFuture<T> f)
Create a FutureType instance from the supplied CompletableFuture
|
static <T> FutureType<T> |
ofError(java.lang.Throwable error)
Construct a completed-with-error FutureW from the given Exception
|
static <T> FutureType<T> |
ofResult(T result)
Construct a successfully completed FutureW from the given value
|
static <T> FutureType<T> |
ofSupplier(java.util.function.Supplier<T> s)
Create a FutureW object that asyncrhonously populates using the Common
ForkJoinPool from the user provided Supplier
|
static <T> FutureType<T> |
ofSupplier(java.util.function.Supplier<T> s,
java.util.concurrent.Executor ex)
Create a FutureW object that asyncrhonously populates using the provided
Executor and Supplier
|
static <T> FutureType<T> |
schedule(long delay,
java.util.concurrent.ScheduledExecutorService ex,
java.util.function.Supplier<T> t)
Schedule the population of a FutureW from the provided Supplier after the specified delay.
|
static <T> FutureType<T> |
schedule(java.lang.String cron,
java.util.concurrent.ScheduledExecutorService ex,
java.util.function.Supplier<T> t)
Schedule the population of a FutureW from the provided Supplier, the provided Cron (Quartz format) expression will be used to
trigger the population of the FutureW.
|
static <T> FutureType<T> |
widen(com.aol.cyclops.control.FutureW<T> futureW)
Convert a FutureW to a simulated HigherKindedType that captures FutureW nature
and FutureW element data type separately.
|
accumulate, accumulate, accumulate, accumulateSuccess, accumulateSuccess, accumulateSuccess, allOf, anyOf, cancel, canEqual, cast, coflatMap, combine, combine, combineEager, complete, completeExceptionally, equals, filter, filterNot, firstSuccess, flatMap, flatMapCf, flatMapIterable, flatMapPublisher, flatten, fromTry, fromTry, get, getFuture, hashCode, isCancelled, isDone, isFailed, isPresent, isSuccess, iterator, map, map, map, matches, mkString, nest, notNull, ofType, patternMatch, peek, quorum, recover, sequence, sequence, stream, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toIor, toOptional, toString, toXor, trampoline, unit, zip, zip, zip, zip, zip, zip, zip
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
applyFunctions
collect, fold, fold, generate, iterate, mapReduce, newSubscriber, of, subscribe, test, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFeatureToggle, toFutureStream, toFutureStream, toLazyImmutable, toList, toListX, toMaybe, toMutable, toPBagX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toTry, toTry, toTry, toXor, unapply
endsWith, endsWithIterable, findAny, findFirst, firstValue, foldable, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, join, join, join, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, xMatch
public static <T> FutureType<T> empty()
public static <T> FutureType<T> future()
public static <T> FutureType<T> narrowK(com.aol.cyclops.hkt.alias.Higher<FutureType.µ,T> future)
future
- HKT encoded list into a FutureTypepublic static <T> FutureType<T> fromPublisher(org.reactivestreams.Publisher<T> pub, java.util.concurrent.Executor ex)
ReactiveSeq<Integer> stream = ReactiveSeq.of(1,2,3);
FutureType<Integer> future = FutureType.fromPublisher(stream,ex);
//FutureType[1]
pub
- Publisher to extract value fromex
- Executor to extract value onpublic static <T> FutureType<T> fromIterable(java.lang.Iterable<T> iterable, java.util.concurrent.Executor ex)
ReactiveSeq<Integer> stream = ReactiveSeq.of(1,2,3);
FutureType<Integer> future = FutureType.fromIterable(stream,ex);
//FutureType[1]
iterable
- Iterable to generate a FutureW fromex
- Executor to extract value onpublic static <T> FutureType<T> fromPublisher(org.reactivestreams.Publisher<T> pub)
ReactiveSeq<Integer> stream = ReactiveSeq.of(1,2,3);
FutureType<Integer> future = FutureType.fromPublisher(stream);
//FutureW[1]
pub
- Publisher to extract value frompublic static <T> FutureType<T> fromIterable(java.lang.Iterable<T> iterable)
ReactiveSeq<Integer> stream = ReactiveSeq.of(1,2,3);
FutureType<Integer> future = FutureType.fromIterable(stream);
//FutureType[1]
iterable
- Iterable to extract value frompublic static <T> FutureType<T> of(java.util.concurrent.CompletableFuture<T> f)
f
- CompletableFuture to wrap as a FutureWpublic static <T> FutureType<T> schedule(java.lang.String cron, java.util.concurrent.ScheduledExecutorService ex, java.util.function.Supplier<T> t)
FutureType<String> future = FutureType.schedule("* * * * * ?", Executors.newScheduledThreadPool(1), ()->"hello");
//FutureType["hello"]
cron
- Cron expression in Quartz formatex
- ScheduledExecutorService used to execute the provided Suppliert
- The Supplier to execute to populate the FutureWpublic static <T> FutureType<T> schedule(long delay, java.util.concurrent.ScheduledExecutorService ex, java.util.function.Supplier<T> t)
FutureW<String> future = FutureW.schedule(10l, Executors.newScheduledThreadPool(1), ()->"hello");
//FutureW["hello"]
delay
- Delay after which the FutureW should be populatedex
- ScheduledExecutorService used to execute the provided Suppliert
- he Supplier to execute to populate the FutureWpublic static <T> FutureType<T> ofSupplier(java.util.function.Supplier<T> s)
s
- Supplier to asynchronously populate results frompublic static <T> FutureType<T> ofSupplier(java.util.function.Supplier<T> s, java.util.concurrent.Executor ex)
s
- Supplier to asynchronously populate results fromex
- Executro to asynchronously populate results withpublic static <T> FutureType<T> ofResult(T result)
result
- To wrap inside a FutureWpublic static <T> FutureType<T> ofError(java.lang.Throwable error)
error
- To wrap inside a FutureWpublic static <T> FutureType<T> widen(com.aol.cyclops.control.FutureW<T> futureW)
FutureW
- FutureW to widen to a FutureWTypepublic static <T> com.aol.cyclops.control.FutureW<T> narrow(com.aol.cyclops.hkt.alias.Higher<FutureType.µ,T> futureW)
FutureW
- Type Constructor to convert back into narrowed typepublic static <T> java.util.concurrent.CompletableFuture<T> narrowCompletableFuture(com.aol.cyclops.hkt.alias.Higher<FutureType.µ,T> futureW)
Future
- Type Constructor to convert back into narrowed typepublic com.aol.cyclops.control.FutureW<T> narrow()