Skip to content

Instantly share code, notes, and snippets.

@halorgium
Last active December 16, 2015 04:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halorgium/5371ea0a410821810d73 to your computer and use it in GitHub Desktop.
Save halorgium/5371ea0a410821810d73 to your computer and use it in GitHub Desktop.
supervision rethought
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