-
-
Save halorgium/5371ea0a410821810d73 to your computer and use it in GitHub Desktop.
supervision rethought
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Child | |
include Celluloid | |
end | |
class Parent | |
include Celluloid | |
def initialize(name) | |
3.times do |n| | |
Child.new("child-#{n}") | |
end | |
end | |
end | |
2.times do |n| | |
Parent.new("parent-#{n}") | |
end | |
# After this, the supervision tree might looks like this | |
# Unsure about the API for naming the actors at this stage | |
# Upon restarting, the arguments passed to `new` would be called as well. | |
# root | |
# |-- system | |
# | |-- logging | |
# | | |-- ... | |
# | | +-- ... | |
# | +-- notifications | |
# +-- user | |
# |-- parent | |
# | |--- child | |
# | |--- child | |
# | |--- { ... } | |
# | +--- child | |
# |-- parent | |
# |--- child | |
# |--- child | |
# |--- { ... } | |
# +--- child |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment