kostya / eye

Process monitoring tool. Inspired from Bluepill and God.
MIT License
1.19k stars 86 forks source link

Possible to use Eye without config file, direct Ruby interface? #117

Closed olavolav closed 9 years ago

olavolav commented 9 years ago

I'm writing a worker process supervisor with a dynamic number of workers, and are considering using Eye for the actual starting/stopping/monitoring. I.e. my supervisor would handle the logic about how many processes of which kind are needed at any given time, and send that information to Eye for the actual execution.

Is there a nicer, more direct way that creating an automatic Eye config file and triggering a system call to load the new config into Eye?

kostya commented 9 years ago

i think should be easy to write:

you can do it in bundle console:

Eye::Control.command('load', File.expand_path('examples/test.eye'))
Eye::Control.command('info_data')
Eye::Control.command('stop', 'all')

to work in more low level, read how load command work: https://github.com/kostya/eye/blob/master/lib/eye/controller/load.rb#L11

or for example https://github.com/tablexi/eye-patch, which write self yml configs.

olavolav commented 9 years ago

Great, I'll take a look, thanks!

kostya commented 9 years ago

you can ask questions here, if it appears