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
46 47 48 |
# File 'lib/ruby-daemonic-threads/process.rb', line 46 def before_exit @queues.store_and_close end |
#join ⇒ Object
36 37 38 39 |
# File 'lib/ruby-daemonic-threads/process.rb', line 36 def join @http.join @daemons.join end |
#start ⇒ Object
31 32 33 34 |
# File 'lib/ruby-daemonic-threads/process.rb', line 31 def start @http.start @daemons.start end |
#stop ⇒ Object
41 42 43 44 |
# File 'lib/ruby-daemonic-threads/process.rb', line 41 def stop @http.stop @daemons.stop end |