Supervisors; with Supervision Containers (Groups), Configurations, and Trees for Celluloid.
To supervise actors, you have many options:
Using supervisors.
Directly
MyActor.supervise as: :my_actor
MyActor.supervise as: :my_actor, args: [:one_arg, :two_args]
Indirectly
Celluloid.supervise as: :my_actor, type: MyActor
Celluloid.supervise as: :my_actor, type: MyActor, args: [:one_arg, :two_args]
Using containers.
container = Celluloid::Supervision::Container.new {
supervise type: MyActor, as: :my_actor
supervise type: MyActor, as: :my_actor_with_args, args: [:one_arg, :two_args]
}
container.run!
Using configuration objects:
config = Celluloid::Supervision::Configuration.define([
{
type: MyActor,
as: :my_actor
},
{
type: MyActor,
as: :my_actor_with_args,
args: [
:one_arg,
:two_args
]
},
])
config.deploy
config.shutdown
config.deploy
By on-going configuration object:
config = Celluloid::Supervision::Configuration.new
config.define type: MyActor, as: :my_actor
config.define type: MyActor, as: :my_actor_with_args, args: [:one_arg, :two_args]
config deploy
config.add type: MyActor, as: :my_actor_deployed_immediately
config.shutdown
Documentation coming:
- Supervision Trees
- Supervised Pools
- Supervised Supervisors
Contributing
- Fork this repository on github.
- Make your changes and send us a pull request.
- If we like them we'll merge them.
- If we've accepted a patch, feel free to ask for commit access.
License
Copyright (c) 2011-2015 Tony Arcieri, Donovan Keme.
Distributed under the MIT License. See LICENSE.txt for further details.