SuperWorker.Supervisor.Looper (SuperWorker v0.6.0)

Copy Markdown View Source

Main message loop for partition processes.

Each SuperWorker.Supervisor runs one or more partitions; every partition executes main_loop/1, which receives and dispatches:

  • public API messages ({:public_api, %Message{}}) sent by users through the SuperWorker.Supervisor API;
  • internal API messages ({:internal_api, %Message{}}) exchanged between the supervisor master and its partitions (partition lists, restarts, shutdown);
  • worker :DOWN messages, which trigger restart handling according to the restart strategy of the worker's parent (standalone/group/chain);
  • EXIT messages from linked outside processes (ignored).

The loop only exits when a deliberate shutdown is requested.

Summary

Functions

main_loop(state)