Worker

object Worker
Companion:
class
class Object
trait Matchable
class Any
Worker.type

Value members

Concrete methods

def create[Actor, Context](isComplete: WorkContext[Actor, Context] => Job => Boolean, onComplete: WorkContext[Actor, Context] => Job => Outcome[(List[Job], Actor)], doWork: WorkContext[Actor, Context] => Job => (Job, Actor), jobGenerator: WorkContext[Actor, Context] => List[Job], jobAcceptable: WorkContext[Actor, Context] => Job => Boolean): Worker[Actor, Context]

Convenience function for creating Worker instances.

Convenience function for creating Worker instances.

Value parameters:
doWork

a function the explains how the worker does the work

isComplete

has the work been completed?

jobAcceptable

predicate used by the job market to decide if a job is suitable for this worker

jobGenerator

when called, generates jobs.

onComplete

results of work completion, more jobs or events.

Returns:

a Worker instance