Closed pinyin closed 9 years ago
@pinyin thank you! there wasn't one, but what do you think about this?
https://github.com/kenichi/angelo/compare/supervise
used something like this:
require 'angelo'
class S < Angelo::Base
get '/' do
''
end
end
s = S.run S.addr, S.port, supervise_as: :s
puts "supervised: #{Celluloid::Actor[:s]}"
sleep
makes me want to change the api of Base#run and #run! to take opts hash only...
@kenichi and make sure you anticipate 0.17.0
where supervise_as
is no longer used!
@digitalextremist ah good to know. 0.17.0 is huge, can you point me to any specifics about this?
Well @kenichi, for one, supervision moved to its own gem: celluloid-supervision
... but as of now, 0.17.0
includes that gem out-of-the-box. In the future, it may not. Doesn't hurt to include that gem then.
As of now, you need to add submodules: true
and use github in your Gemfile
...
As for specific syntax, you will be using as: :name
or name: :name
( an alias ) ... and using #supervise
And documentation of changes is sparse right now, which I am working on. Mostly there is new example code and updated tests.
Ah that's super fast!
Thanks. My issue is closed.
Hi,
Thanks for the elegant work.
It seems that
Angelo::Base.run()
usesAngelo::Server.new
to start a new server instance, so I cannot callAngelo::Server.supervise_as
manually like using other Celluloid actors.Is there a recommended way to make a supervised server always available in
Celluloid::Actor[]
?