Actor Reference

Actor


class py_actors.actors.Actor

Generic actor that receives a message and performs the developer-defined on_receive

static call(actor)

Method used by the kernel to define an actor’s workflow

do_lookup(name)

Method to return an actor’s name

on_complete()

Method that defines what an actor should do upon successful completion

on_init(lookup)

Method used by the kernel to set up an actor

classmethod on_receive(message)

Class method that defines what the actor should do with the message it received. This is the actor’s ‘function’

on_shutdown()

Method that defines what an actor should do when shut down, whether it has completed or not

post(message)

Method to put a message in an actor’s (FIFO) queue

shutdown()

Method to turn an actor off

Batch Join Actor


class py_actors.actors.BatchJoinActor(key_list)

Special-case actor that receives messages from batch actors and adds them to a list

on_receive(message)

Method that receives messages and adds them to a results list using Python’s extend

Batch Split Actor


class py_actors.actors.BatchSplitActor(key_list, batch_size=256)

Special-case actor that splits messages into batches that will be processed by worker actors

on_receive(message)

Method that splits messages into batches for workers until a batch size is reached, at which point the batch will be sent to the worker

Countdown Actor


class py_actors.actors.CountdownActor(count)

Special-case actor that will process a pre-determined amount of messages before shutting down

classmethod do_work(message)

Class method that defines what the actor should do with the message it received

on_receive(message)

Method that does work on a message and then decrements the actor’s counter

Join Actor


class py_actors.actors.JoinActor(key_list)

Special-case actor that receives messages from actors and adds them to a list

on_receive(message)

Method that puts messages in a results list

Split Actor


class py_actors.actors.SplitActor(key_list)

Special-case actor that splits messages to be be processed by worker actors

on_receive(message)

Method that splits messages among worker actors