Class: Workpile::Child
- Inherits:
-
Object
- Object
- Workpile::Child
- Defined in:
- lib/workpile.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
-
#initialize(index = ARGV.pop, uri = ARGV.pop) ⇒ Child
constructor
A new instance of Child.
- #wait_request ⇒ Object
Constructor Details
#initialize(index = ARGV.pop, uri = ARGV.pop) ⇒ Child
Returns a new instance of Child.
86 87 88 89 90 |
# File 'lib/workpile.rb', line 86 def initialize(index = ARGV.pop, uri = ARGV.pop) @index = index @service = DRbObject.new_with_uri(uri) @service.add_boot_client(Process.pid) end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
85 86 87 |
# File 'lib/workpile.rb', line 85 def index @index end |
Instance Method Details
#wait_request ⇒ Object
92 93 94 95 96 97 98 99 100 |
# File 'lib/workpile.rb', line 92 def wait_request req = @service.pop @service.add_working_client(Process.pid) at_exit do @service.remove_working_client(Process.pid) @service.remove_boot_client(Process.pid) end req end |