ThreadManagerBuilder

de.halcony.processes.threading.ThreadManagerBuilder
class ThreadManagerBuilder[T](lambda: T => Unit)

Utility to build a thread manager that uses the provided lambda to process incoming jobs

Type parameters

T

the type of the job to be processed

Value parameters

lambda

the lambda to process a given job

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addJob(job: T): ThreadManagerBuilder[T]
def addJobs(jobs: Seq[T]): ThreadManagerBuilder[T]
def create(): ThreadManager[T]

create the configured ThreadManager

create the configured ThreadManager

Attributes

Returns

the configured ThreadManager

def handleErrors(onError: (Option[T], Throwable) => Option[(Option[T], Throwable)]): ThreadManagerBuilder[T]

provide function to handle errors encountered during processing

provide function to handle errors encountered during processing

process the provided error. If some return, the error will be stored. If none return the error is discarded afterward

Value parameters

onError

the function to process the error

Attributes

Returns

the current ThreadManagerBuilder

def setLogLevel(level: LogLevel): ThreadManagerBuilder[T]
def start(): ThreadManager[T]

create the configured ThreadManager and start it as well

create the configured ThreadManager and start it as well

Attributes

Returns

the configured ThreadManager

def threadCount(count: Int): ThreadManagerBuilder[T]

set the number of threads to be used in parallel (default: #cores)

set the number of threads to be used in parallel (default: #cores)

Value parameters

count

the number of threads

Attributes

Returns

the current ThreadManagerBuilder