Class: Async::Enumerator
- Inherits:
-
Object
- Object
- Async::Enumerator
- Includes:
- Enumerable
- Defined in:
- lib/async/enumerator.rb
Overview
Wrapper providing async enumerable methods for parallel execution. See docs/reference/enumerator.md for detailed documentation.
Constant Summary
Constants included from Enumerable
Instance Method Summary collapse
-
#initialize(enumerable = [], config = nil, **kwargs) ⇒ Enumerator
constructor
Creates async wrapper for enumerable.
Methods included from Enumerable
Methods included from Async::Enumerable::Configurable
#__async_enumerable_collection, #__async_enumerable_collection_ref, #__async_enumerable_config_ref, #__async_enumerable_configure, #__async_enumerable_merge_all_config, included
Constructor Details
#initialize(enumerable = [], config = nil, **kwargs) ⇒ Enumerator
Creates async wrapper for enumerable.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/async/enumerator.rb', line 14 def initialize(enumerable = [], config = nil, **kwargs) @enumerable = enumerable # Only configure if config or kwargs are provided if config || !kwargs.empty? __async_enumerable_configure do |cfg| # Merge config if provided config&.to_h&.each do |key, val| cfg[key] = val if val end # Merge kwargs if provided kwargs.each do |key, val| cfg[key] = val if val end end end end |