
## Architecture

- [ ] the systems is formed by:
    - [ ] a worker class that performs the dispatching of messages to the appropriate handlers.
    - [ ] a broker that can register multiple workers, so messages to a particular worker will be pushed into its (single) input queue.
    - [ ] a worker instance can be registered in the broker using multiple patterns, so can be used to handle different types of from these patterns.


## Worker

- [ ] event loop that takes messages from a queue and processes them asynchronously.
- [ ] handler functions are instance methods
- [ ] queue are fast lists alike memory containers.
- [ ] a worker is waiting a signal to start processing messages.
- [ ] the signal is sent by the broker when a message is received for him.


## Broker

- [ ] when a message is received by the broker, then it decides to which brokers will be used for attending the message.
- [ ] depending on the message type, the broker can dispatch the message to:
    - [ ] all workers in a group.
    - [ ] a single one in the group (round robing).
    - [ ] a single worker (no group, the group is itself).

- [ ] the broker will raise a signal for the worker when a message is received for him.


## Tests

### Test 01

- [ ] a main process that create a broker and a worker.
- [ ] the worker is registered in the broker.
- [ ] the broker is started.
- [ ] the worker is started.
- [ ] the worker is stopped.
- [ ] the broker is stopped.

### Test 02

- [ ] a RPN calculator that can perform basic arithmetic operations.
- [ ] the calculator is registered in the broker.
- [ ] the broker is started.
- [ ] the calculator is started.
- [ ] a external process that sends messages to the broker.
- [ ] the worker handles all messages.
- [ ] the calculator is stopped.
- [ ] the broker is stopped.
