Worker Restart Options
So far we’ve looked at supervision from the point of view of the supervisor. In particular, we’ve seen how the supervision strategy tells the supervisor how to deal with the death of a child process.
There’s a second level of configuration that applies to individual workers. The most commonly used of these is the :restart option.
Previously we said that a supervisor strategy (such as :one_for_all) is invoked when a worker dies. That’s not strictly true. Instead, the strategy is invoked when a worker needs restarting. And the conditions when a worker should be restarted are dictated by its restart: option:
- :permanent
-
This worker should always be running—it is permanent. This means that the supervision strategy will be applied ...
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.
Read now
Unlock full access