Module: ModernTimes::Base::Worker
- Included in:
- JMS::Worker
- Defined in:
- lib/modern_times/base/worker.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#thread ⇒ Object
Returns the value of attribute thread.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(options = {}) ⇒ Object
- #join ⇒ Object
-
#setup ⇒ Object
One time initialization prior to first thread.
- #start ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
5 6 7 |
# File 'lib/modern_times/base/worker.rb', line 5 def index @index end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/modern_times/base/worker.rb', line 4 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/modern_times/base/worker.rb', line 4 def @options end |
#thread ⇒ Object
Returns the value of attribute thread.
5 6 7 |
# File 'lib/modern_times/base/worker.rb', line 5 def thread @thread end |
Class Method Details
.included(base) ⇒ Object
18 19 20 |
# File 'lib/modern_times/base/worker.rb', line 18 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#initialize(options = {}) ⇒ Object
22 23 24 25 |
# File 'lib/modern_times/base/worker.rb', line 22 def initialize(={}) @name = [:name] || self.class.default_name @options = end |
#join ⇒ Object
39 40 41 |
# File 'lib/modern_times/base/worker.rb', line 39 def join thread.join end |
#setup ⇒ Object
One time initialization prior to first thread
28 29 |
# File 'lib/modern_times/base/worker.rb', line 28 def setup end |
#start ⇒ Object
31 32 33 |
# File 'lib/modern_times/base/worker.rb', line 31 def start raise "Need to override start method in #{self.class.name}" end |
#status ⇒ Object
43 44 45 |
# File 'lib/modern_times/base/worker.rb', line 43 def status raise "Need to override status method in #{self.class.name}" end |
#stop ⇒ Object
35 36 37 |
# File 'lib/modern_times/base/worker.rb', line 35 def stop raise "Need to override stop method in #{self.class.name}" end |