Workers

MudPi consists of multiple workers that are each responsible for a certain set of actions. MudPi takes advantage of multi threading to prevent blocking updates or long processing cycles. Each worker will run on its own thread and uses threading events along with the event system to communicate internally. This is why the event systm is used to utilize its Pub/Sub capabilities for externally interacting with threads such as telling the system to turn on the toggle to power the pump.

Worker Responsibilities

The purpose of the workers is to control a section of MudPi and offload that process through multi-threading to prevent long read chains. One of the core tasks a worker provides is gathering an publishing data on the event system.

Errors in Workers

Sometimes errors happen in electronics. More often than anticipated, however MudPi is fairly resilient to errors and will usually eat minor ones. In the event there is a breaking error on a worker, MudPi can keep running all the other workers currently loaded. A worker can not be restarted by itself in the event of an error, the whole system should be rebooted.