Class: Forkit::Enumerable
- Inherits:
-
Object
- Object
- Forkit::Enumerable
- Defined in:
- lib/forkit/enumerable.rb
Overview
The enumerable allows for concurrent processing via JDK7’s ForkJoinPool.
Instance Attribute Summary collapse
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
- #objects The array to process.(Thearraytoprocess.) ⇒ Object readonly
-
#threshold ⇒ Object
readonly
Returns the value of attribute threshold.
- #threshold The single process threshold count.(Thesingleprocessthresholdcount.) ⇒ Object readonly
Instance Method Summary collapse
-
#each(&block) ⇒ nil
Execute the provided block for each element in the array.
-
#initialize(objects, threshold) ⇒ Forkit::Enumerable
constructor
Instantiate the new concurrent enumerable.
Constructor Details
#initialize(objects, threshold) ⇒ Forkit::Enumerable
Instantiate the new concurrent enumerable.
24 25 26 |
# File 'lib/forkit/enumerable.rb', line 24 def initialize(objects, threshold) @objects, @threshold = objects, threshold end |
Instance Attribute Details
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
11 12 13 |
# File 'lib/forkit/enumerable.rb', line 11 def objects @objects end |
#objects The array to process.(Thearraytoprocess.) ⇒ Object (readonly)
11 |
# File 'lib/forkit/enumerable.rb', line 11 attr_reader :objects, :threshold |
#threshold ⇒ Object (readonly)
Returns the value of attribute threshold.
11 12 13 |
# File 'lib/forkit/enumerable.rb', line 11 def threshold @threshold end |
#threshold The single process threshold count.(Thesingleprocessthresholdcount.) ⇒ Object (readonly)
11 |
# File 'lib/forkit/enumerable.rb', line 11 attr_reader :objects, :threshold |