Parallel

object Parallel extends LogSupport

Utilities for parallel execution.

trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any

Type members

Classlikes

class ParallelExecutionStats(val totalThreads: AtomicLong, val runningWorkers: AtomicLong, val startedTasks: AtomicLong, val finishedTasks: AtomicLong)

Value members

Concrete methods

def break: Unit
def iterate[T, R](source: Iterator[T], parallelism: Int)(f: T => R): Iterator[R]

Process all elements of the source by the given function then don't wait completion. The result is an iterator which is likely a stream which elements are pushed continuously.

Process all elements of the source by the given function then don't wait completion. The result is an iterator which is likely a stream which elements are pushed continuously.

Value parameters:
f

Function which processes each element of the source collection

parallelism

Parallelism, the default value is a number of available processors

source

the source iterator

Returns:

Iterator of the results

def run[T, R : ClassTag](source: Seq[T], parallelism: Int)(f: T => R): Seq[R]

Process all elements of the source by the given function then wait for the completion.

Process all elements of the source by the given function then wait for the completion.

Value parameters:
f

Function which processes each element of the source collection

parallelism

Parallelism, the default value is a number of available processors

source

Source collection

Returns:

Collection of the results

Inherited methods

inline protected def debug(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def debug(inline message: Any): Unit
Inherited from:
LoggingMethods
inline protected def error(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def error(inline message: Any): Unit
Inherited from:
LoggingMethods
inline protected def info(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def info(inline message: Any): Unit
Inherited from:
LoggingMethods
inline protected def logAt(inline logLevel: LogLevel, inline message: Any): Unit
Inherited from:
LoggingMethods
inline protected def trace(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def trace(inline message: Any): Unit
Inherited from:
LoggingMethods
inline protected def warn(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def warn(inline message: Any): Unit
Inherited from:
LoggingMethods

Concrete fields