Class: Mule::Job
- Inherits:
-
Object
- Object
- Mule::Job
- Defined in:
- lib/mule/job.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#file ⇒ Object
Returns the value of attribute file.
-
#workers ⇒ Object
Returns the value of attribute workers.
Instance Method Summary collapse
- #after_fork(&block) ⇒ Object
- #before_fork(&block) ⇒ Object
-
#initialize ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize ⇒ Job
Returns a new instance of Job.
6 7 8 9 10 11 12 |
# File 'lib/mule/job.rb', line 6 def initialize @workers = 1 @events = { :before_fork => Proc.new {}, :after_fork => Proc.new {} } end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
4 5 6 |
# File 'lib/mule/job.rb', line 4 def events @events end |
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/mule/job.rb', line 3 def file @file end |
#workers ⇒ Object
Returns the value of attribute workers.
3 4 5 |
# File 'lib/mule/job.rb', line 3 def workers @workers end |
Instance Method Details
#after_fork(&block) ⇒ Object
18 19 20 |
# File 'lib/mule/job.rb', line 18 def after_fork(&block) @events[:after_fork] = block if block_given? end |
#before_fork(&block) ⇒ Object
14 15 16 |
# File 'lib/mule/job.rb', line 14 def before_fork(&block) @events[:before_fork] = block if block_given? end |