liveBook · Manning

Worker actor

As explained in Akka in Action, Second Edition

A worker actor processes an assigned individual piece of a larger task and may return a result to a coordinating actor.

A worker actor handles one assigned unit of a larger job, then returns a result to a coordinating actor. A guardian can pass a collection to a manager, which splits it into pieces and delegates each piece to workers. This keeps coordination separate from the business operation performed for each item. section 3.1 section 3.1.1

Figure 3.2 Direction of messages between the manager and the workers
CH03_F02_Abraham2

Messages flow from the manager to workers for processing, then back to the manager as completion notifications. section 3.1

A worker interaction commonly follows this sequence:

Parsing one text per worker

A manager creates one worker for each text. Each worker receives Parse with its text and a reply target, removes hyphens, sends Done, and stops. Because the worker response belongs to the worker’s protocol, the manager uses a message adapter to turn that response into a message it can handle. section 3.1.8 section 3.1.3

In clustered job processing, workers can run on aggregator nodes while a master runs on a director node. Workers register with a receptionist key, receive texts through a router, count words asynchronously, and return a Map of word frequencies. The master merges successful counts; timed-out work goes back to a lag queue for reprocessing. section 8.4 section 8.4.3

How Akka in Action, Second Edition covers it

How deep it goes
Explains command/reply protocols, adapters, lifecycle choices, routing, registration, timeouts, and result aggregation without detailing real input endpoints.
Examples
Uses hyphen-removing text parsers, delayed file parsing, and clustered word-frequency counting with returned maps.
What it assumes
Teaches worker delegation through actor spawning and protocols while deferring external HTTP or gRPC entry points.
What you can do after
Build worker actors that receive assigned work, reply to coordinators, and participate in local or clustered job distribution.
How it connects
Connects worker actors with actor hierarchy, message adapters, ask, routers, receptionist registration, serialization, and lag queues.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Akka in Action, Second Edition. The section links point to the parts of the book it draws on.