Package org.neo4j.gds.core.concurrency
Class RunWithConcurrency.Builder
- java.lang.Object
-
- org.neo4j.gds.core.concurrency.ImmutableRunWithConcurrency.Builder
-
- org.neo4j.gds.core.concurrency.RunWithConcurrency.Builder
-
- Enclosing interface:
- RunWithConcurrency
public static final class RunWithConcurrency.Builder extends org.neo4j.gds.core.concurrency.ImmutableRunWithConcurrency.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Try to run all tasks for their side effects using at mostImmutableRunWithConcurrency.concurrency()threads at once.RunWithConcurrency.Buildertasks(java.lang.Iterable<? extends java.lang.Runnable> tasks)Provides the tasks from an existingIterable.RunWithConcurrency.Buildertasks(java.util.stream.Stream<? extends java.lang.Runnable> tasks)Provides the tasks from aStreamof tasks by usingBaseStream.iterator().RunWithConcurrency.BuilderwaitTime(long waitTime, java.util.concurrent.TimeUnit waitTimeUnit)Sets theRunWithConcurrency.waitTime()together with itsRunWithConcurrency.waitTimeUnit()Provides the tasks from an existingIterable.
-
-
-
Method Detail
-
tasks
public RunWithConcurrency.Builder tasks(java.lang.Iterable<? extends java.lang.Runnable> tasks)
Provides the tasks from an existingIterable.
-
tasks
public RunWithConcurrency.Builder tasks(java.util.stream.Stream<? extends java.lang.Runnable> tasks)
Provides the tasks from aStreamof tasks by usingBaseStream.iterator().
-
waitTime
public RunWithConcurrency.Builder waitTime(long waitTime, java.util.concurrent.TimeUnit waitTimeUnit)
Sets theRunWithConcurrency.waitTime()together with itsRunWithConcurrency.waitTimeUnit()Provides the tasks from an existingIterable.
-
run
public void run()
Try to run all tasks for their side effects using at mostImmutableRunWithConcurrency.concurrency()threads at once.This will build the
RunWithConcurrencyobject and immediately callRunWithConcurrency.run().
-
-