Class: ConcurrentEnumerable::Parallel
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ConcurrentEnumerable::Parallel
- Includes:
- EnumerableInterface
- Defined in:
- lib/concurrent_enumerable/parallel.rb
Instance Method Summary collapse
-
#initialize(list, opts = {}) ⇒ Parallel
constructor
A new instance of Parallel.
- #parallel ⇒ Object
- #serial ⇒ Object
Methods included from EnumerableInterface
Constructor Details
#initialize(list, opts = {}) ⇒ Parallel
Returns a new instance of Parallel.
7 8 9 10 11 12 |
# File 'lib/concurrent_enumerable/parallel.rb', line 7 def initialize(list, opts = {}) super list @opts = opts @executor = Concurrent::OptionsParser.get_executor_from(opts) || \ Concurrent.configuration.global_task_pool end |
Instance Method Details
#parallel ⇒ Object
14 15 16 |
# File 'lib/concurrent_enumerable/parallel.rb', line 14 def parallel self end |
#serial ⇒ Object
18 19 20 |
# File 'lib/concurrent_enumerable/parallel.rb', line 18 def serial __getobj__ end |