Skip to Main Content
Programming Phoenix
book

Programming Phoenix

by Chris McCord, Bruce Tate, Jose Valim
April 2016
Beginner to intermediate content levelBeginner to intermediate
300 pages
6h 58m
English
Pragmatic Bookshelf
Content preview from Programming Phoenix

Supervision Strategies

Just as child workers have different restart strategies, supervisors have configurable supervision strategies. The most basic and the default for new Phoenix applications is :one_for_one. When a :one_for_one supervisor detects a crash, it restarts a worker of the same type without any other consideration. Sometimes, processes depend on one another. When that happens, sometimes when a process dies, more than one must restart. In all, you have four major strategies:

:one_for_one

If a child terminates, a supervisor restarts only that process.

:one_for_all

If a child terminates, a supervisor terminates all children and then restarts all children.

:rest_for_one

If a child terminates, a supervisor terminates all child processes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Elm

Programming Elm

Jeremy Fairbank
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781680501926Errata Page