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 void
run()
Try to run all tasks for their side effects using at mostImmutableRunWithConcurrency.concurrency()
threads at once.RunWithConcurrency.Builder
tasks(java.lang.Iterable<? extends java.lang.Runnable> tasks)
Provides the tasks from an existingIterable
.RunWithConcurrency.Builder
tasks(java.util.stream.Stream<? extends java.lang.Runnable> tasks)
Provides the tasks from aStream
of tasks by usingBaseStream.iterator()
.RunWithConcurrency.Builder
waitTime(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 aStream
of 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
RunWithConcurrency
object and immediately callRunWithConcurrency.run()
.
-
-