Worker

indigoextras.jobs.Worker
See theWorker companion object
trait Worker[Actor, Context]

Represents a Worker for a given Actor

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def canTakeJob(context: WorkContext[Actor, Context]): Job => Boolean

Predicate discriminator used to determine if a worker can carry out a job.

Predicate discriminator used to determine if a worker can carry out a job.

Value parameters

context

Information about the context the worker is in

Attributes

Returns

Job => Boolean

def generateJobs(context: WorkContext[Actor, Context]): List[Job]

The worker has nothing to do, create jobs from within the given context.

The worker has nothing to do, create jobs from within the given context.

Value parameters

context

Information about the context the worker is in

Attributes

Returns

List[Job]

def isJobComplete(context: WorkContext[Actor, Context]): Job => Boolean

Test whether an actor thinks a job is complete.

Test whether an actor thinks a job is complete.

Value parameters

context

Information about the context the worker is in

Attributes

Returns

Job => Boolean

def onJobComplete(context: WorkContext[Actor, Context]): Job => Outcome[(List[Job], Actor)]

When a job is completed, produce an outcome of any new jobs and an updated Actor.

When a job is completed, produce an outcome of any new jobs and an updated Actor.

Value parameters

context

Information about the context the worker is in

Attributes

Returns

Job => Outcome[(List[Job], Actor)]

def workOnJob(context: WorkContext[Actor, Context]): Job => (Job, Actor)

A function describing how this actor does work on whichever jobs they are able to work on.

A function describing how this actor does work on whichever jobs they are able to work on.

Value parameters

context

Information about the context the worker is in

Attributes

Returns

Job => (Job, Actor)