Class: EventedBluepill::AppProxy
- Inherits:
-
Object
- Object
- EventedBluepill::AppProxy
- Defined in:
- lib/evented_bluepill/dsl/app_proxy.rb
Constant Summary collapse
- APP_ATTRIBUTES =
[:working_dir, :uid, :gid, :environment]
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#initialize(app_name, options) ⇒ AppProxy
constructor
A new instance of AppProxy.
- #process(process_name, &process_block) ⇒ Object
Constructor Details
#initialize(app_name, options) ⇒ AppProxy
Returns a new instance of AppProxy.
13 14 15 |
# File 'lib/evented_bluepill/dsl/app_proxy.rb', line 13 def initialize(app_name, ) @app = Application.new(app_name.to_s, ) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
11 12 13 |
# File 'lib/evented_bluepill/dsl/app_proxy.rb', line 11 def app @app end |
Instance Method Details
#process(process_name, &process_block) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/evented_bluepill/dsl/app_proxy.rb', line 17 def process(process_name, &process_block) attributes = {} APP_ATTRIBUTES.each {|a| attributes[a] = self.send(a) } process_factory = ProcessFactory.new(attributes, process_block) process = process_factory.create_process(process_name, @app.pids_dir) group = process_factory.attributes.delete(:group) @app.add_process(process, group) end |