Uses of Class
fj.control.parallel.Strategy
-
Packages that use Strategy Package Description fj Types that set the premise for the existence of Functional Java.fj.control.parallel Parallelization strategies.fj.data Common algebraic data types. -
-
Uses of Strategy in fj
Methods in fj with parameters of type Strategy Modifier and Type Method Description default F<A,Promise<B>>
F. promiseK(Strategy<Unit> s)
Promotes this function to a concurrent function that returns a Promise of a value. -
Uses of Strategy in fj.control.parallel
Fields in fj.control.parallel declared as Strategy Modifier and Type Field Description private Strategy<Unit>
Actor. s
private Strategy<Unit>
Promise. s
private Strategy<Unit>
ParModule. strategy
Methods in fj.control.parallel that return Strategy Modifier and Type Method Description static <A> Strategy<java.util.concurrent.Callable<A>>
Strategy. callableStrategy(Strategy<java.util.concurrent.Callable<A>> s)
Provides a normalising strategy that fully evaluates its Callable argument.static <A> Strategy<A>
Strategy. completionStrategy(java.util.concurrent.CompletionService<A> s)
Provides a parallelization strategy that uses a CompletionService to control the method and degree of parallelism, and where each parallel task's completion is registered with the service.Strategy<A>
Strategy. contramap(F<P1<A>,P1<A>> f)
Maps the given transformation across this strategy's codomain (Invariant Functor pattern).static <A> Strategy<A>
Strategy. errorStrategy(Strategy<A> s, Effect1<java.lang.Error> e)
Provides an error-handling strategy.Strategy<A>
Strategy. errorStrategy(Effect1<java.lang.Error> e)
Provides an error-handling strategy.static <A> Strategy<A>
Strategy. executorStrategy(java.util.concurrent.ExecutorService s)
Provides a parallelization strategy that uses an ExecutorService to control the method and degree of parallelism.static <A> Strategy<A>
Strategy. idStrategy()
Provides a strategy that performs no evaluation of its argument.Strategy<A>
Strategy. map(F<P1<A>,P1<A>> f)
Maps the given transformation across this strategy's domain (Invariant Functor pattern).static <A> Strategy<A>
Strategy. seqStrategy()
Provides a strategy that performs sequential (non-concurrent) evaluation of its argument.static <A> Strategy<A>
Strategy. simpleThreadStrategy()
Provides a simple parallelization strategy that creates, and discards, a new thread for every evaluation.static <A> Strategy<A>
Strategy. strategy(F<P1<A>,P1<A>> f)
Constructs a strategy from the given evaluation function.<B> Strategy<B>
Strategy. xmap(F<P1<A>,P1<B>> f, F<P1<B>,P1<A>> g)
Maps the given bijective transformation across this strategy (Exponential Functor pattern).Methods in fj.control.parallel with parameters of type Strategy Modifier and Type Method Description static <A> Actor<A>
Actor. actor(Strategy<Unit> s, F<A,P1<Unit>> e)
Creates a new Actor that uses the given parallelization strategy and has the given side-effect.static <A> Actor<A>
Actor. actor(Strategy<Unit> s, Effect1<A> e)
Creates a new Actor that uses the given parallelization strategy and has the given side-effect.static <A> Strategy<java.util.concurrent.Callable<A>>
Strategy. callableStrategy(Strategy<java.util.concurrent.Callable<A>> s)
Provides a normalising strategy that fully evaluates its Callable argument.static <A> Strategy<A>
Strategy. errorStrategy(Strategy<A> s, Effect1<java.lang.Error> e)
Provides an error-handling strategy.static <A,B>
F<List<A>,Promise<B>>Promise. foldRight(Strategy<Unit> s, F<A,F<B,B>> f, B b)
Performs a right-fold reduction across a list in constant stack space.static <A,B>
F<Stream<A>,Promise<B>>Promise. foldRightS(Strategy<Unit> s, F<A,F<P1<B>,B>> f, B b)
Performs a right-fold reduction across a Stream in constant stack space.static <A> Promise<A>
Promise. join(Strategy<Unit> s, P1<Promise<A>> p)
Turns a product of a promise into just a promise.private static <A> Promise<A>
Promise. mkPromise(Strategy<Unit> s)
static <A,B>
P1<Array<B>>Strategy. parFlatMap(Strategy<Array<B>> s, F<A,Array<B>> f, Array<A> as)
Binds the given function in parallel across the given array, using the given strategy, with a final join.static <A,B>
P1<List<B>>Strategy. parFlatMap(Strategy<List<B>> s, F<A,List<B>> f, List<A> as)
Binds the given function in parallel across the given list, using the given strategy, with a final join.static <A> P1<List<A>>
Strategy. parListChunk(Strategy<List<A>> s, int chunkLength, List<P1<A>> as)
Sequentially evaluates chunks (sub-sequences) of a list in parallel.static ParModule
ParModule. parModule(Strategy<Unit> u)
Constructor method for ParModulestatic <A> F<P1<A>,Promise<A>>
Promise. promise(Strategy<Unit> s)
Provides a first-class unit function for promises.static <A,B>
F<A,Promise<B>>Promise. promise(Strategy<Unit> s, F<A,B> f)
Transforms any function so that it returns a promise of a value instead of an actual value.static <A> Promise<A>
Promise. promise(Strategy<Unit> s, P1<A> a)
Promises to provide the value of the given 1-product, in the future.static <A> Promise<java.util.concurrent.Callable<A>>
Promise. promise(Strategy<Unit> s, java.util.concurrent.Callable<A> a)
Provides a promise to call the given Callable in the future.static <T> Actor<T>
Actor. queueActor(Strategy<Unit> s, Effect1<T> ea)
An Actor equipped with a queue and which is guaranteed to process one message at a time.static <A> F<List<Promise<A>>,Promise<List<A>>>
Promise. sequence(Strategy<Unit> s)
First-class version of the sequence function through a List.static <A> Promise<List<A>>
Promise. sequence(Strategy<Unit> s, List<Promise<A>> as)
Turns a List of promises into a single promise of a List.static <A> Promise<Stream<A>>
Promise. sequence(Strategy<Unit> s, Stream<Promise<A>> as)
Turns a Stream of promises into a single promise of a Stream.static <A> Promise<P1<A>>
Promise. sequence(Strategy<Unit> s, P1<Promise<A>> p)
Transforms a product of a promise to a promise of a product.static <A> F<List<Promise<A>>,Promise<List<A>>>
Promise. sequenceS(Strategy<Unit> s)
First-class version of the sequence function through a Stream.Constructors in fj.control.parallel with parameters of type Strategy Constructor Description Actor(Strategy<Unit> s, F<A,P1<Unit>> e)
ParModule(Strategy<Unit> strategy)
Promise(Strategy<Unit> s, Actor<P2<Either<P1<A>,Actor<A>>,Promise<A>>> qa)
-
Uses of Strategy in fj.data
Methods in fj.data with parameters of type Strategy Modifier and Type Method Description private static <A> F<Stream<A>,Promise<Stream<A>>>
Stream. flt(Ord<A> o, Strategy<Unit> s, A x, F<java.lang.Boolean,java.lang.Boolean> f)
private Promise<Stream<A>>
Stream. qs(Ord<A> o, Strategy<Unit> s)
private static <A> F<Stream<A>,Promise<Stream<A>>>
Stream. qs_(Ord<A> o, Strategy<Unit> s)
Stream<A>
Stream. sort(Ord<A> o, Strategy<Unit> s)
Sort this stream according to the given ordering, using a parallel Quick Sort algorithm that uses the given parallelisation strategy.
-