Class: DaemonicThreads::Process
- Inherits:
-
Object
- Object
- DaemonicThreads::Process
- Defined in:
- lib/ruby-daemonic-threads/process.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#daemons ⇒ Object
readonly
Returns the value of attribute daemons.
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#queues ⇒ Object
readonly
Returns the value of attribute queues.
Instance Method Summary collapse
- #before_exit ⇒ Object
-
#initialize(controller) ⇒ Process
constructor
A new instance of Process.
- #join ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(controller) ⇒ Process
Returns a new instance of Process.
19 20 21 22 23 24 25 26 27 |
# File 'lib/ruby-daemonic-threads/process.rb', line 19 def initialize(controller) @controller = controller @name = controller.name @config = DaemonicThreads::Config.new(RAILS_ROOT + '/config/daemons.yml') @http = DaemonicThreads::HTTP::Server.new(self) @queues = DaemonicThreads::Queues.new(self) @daemons = DaemonicThreads::Daemons.new(self) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
29 30 31 |
# File 'lib/ruby-daemonic-threads/process.rb', line 29 def config @config end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
29 30 31 |
# File 'lib/ruby-daemonic-threads/process.rb', line 29 def controller @controller end |
#daemons ⇒ Object (readonly)
Returns the value of attribute daemons.
29 30 31 |
# File 'lib/ruby-daemonic-threads/process.rb', line 29 def daemons @daemons end |
#http ⇒ Object (readonly)
Returns the value of attribute http.
29 30 31 |
# File 'lib/ruby-daemonic-threads/process.rb', line 29 def http @http end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/ruby-daemonic-threads/process.rb', line 29 def name @name end |
#queues ⇒ Object (readonly)
Returns the value of attribute queues.
29 30 31 |
# File 'lib/ruby-daemonic-threads/process.rb', line 29 def queues @queues end |
Instance Method Details
#before_exit ⇒ Object
48 49 50 |
# File 'lib/ruby-daemonic-threads/process.rb', line 48 def before_exit @queues.store end |
#join ⇒ Object
38 39 40 41 |
# File 'lib/ruby-daemonic-threads/process.rb', line 38 def join @http.join @daemons.join end |
#start ⇒ Object
31 32 33 34 35 36 |
# File 'lib/ruby-daemonic-threads/process.rb', line 31 def start @queues.restore @http.start @daemons.start end |
#stop ⇒ Object
43 44 45 46 |
# File 'lib/ruby-daemonic-threads/process.rb', line 43 def stop @http.stop @daemons.stop end |