ruby_reactor 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +105 -0
- data/Rakefile +2 -2
- data/documentation/data_pipelines.md +90 -84
- data/lib/ruby_reactor/async_router.rb +6 -6
- data/lib/ruby_reactor/context_serializer.rb +15 -0
- data/lib/ruby_reactor/dsl/map_builder.rb +6 -2
- data/lib/ruby_reactor/executor/result_handler.rb +1 -0
- data/lib/ruby_reactor/executor/retry_manager.rb +11 -1
- data/lib/ruby_reactor/map/collector.rb +71 -33
- data/lib/ruby_reactor/map/dispatcher.rb +162 -0
- data/lib/ruby_reactor/map/element_executor.rb +59 -56
- data/lib/ruby_reactor/map/execution.rb +16 -3
- data/lib/ruby_reactor/map/helpers.rb +2 -2
- data/lib/ruby_reactor/map/result_enumerator.rb +105 -0
- data/lib/ruby_reactor/step/map_step.rb +48 -16
- data/lib/ruby_reactor/storage/redis_adapter.rb +59 -0
- data/lib/ruby_reactor/template/dynamic_source.rb +32 -0
- data/lib/ruby_reactor/version.rb +1 -1
- metadata +5 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RubyReactor
|
|
4
|
+
module Template
|
|
5
|
+
class DynamicSource < Base
|
|
6
|
+
attr_reader :block, :argument_mappings
|
|
7
|
+
|
|
8
|
+
def initialize(argument_mappings, &block)
|
|
9
|
+
super()
|
|
10
|
+
@block = block
|
|
11
|
+
@argument_mappings = argument_mappings
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def resolve(context)
|
|
15
|
+
args = {}
|
|
16
|
+
@argument_mappings.each do |name, source|
|
|
17
|
+
# Handle serialized template objects if necessary, similar to MapStep logic
|
|
18
|
+
# But here we assume source is a Template object that responds to resolve
|
|
19
|
+
next if source.is_a?(RubyReactor::Template::Element)
|
|
20
|
+
|
|
21
|
+
args[name] = if source.respond_to?(:resolve)
|
|
22
|
+
source.resolve(context)
|
|
23
|
+
else
|
|
24
|
+
source
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
@block.call(args, context)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
data/lib/ruby_reactor/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_reactor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Artur
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dry-validation
|
|
@@ -171,9 +171,11 @@ files:
|
|
|
171
171
|
- lib/ruby_reactor/executor/step_executor.rb
|
|
172
172
|
- lib/ruby_reactor/interrupt_result.rb
|
|
173
173
|
- lib/ruby_reactor/map/collector.rb
|
|
174
|
+
- lib/ruby_reactor/map/dispatcher.rb
|
|
174
175
|
- lib/ruby_reactor/map/element_executor.rb
|
|
175
176
|
- lib/ruby_reactor/map/execution.rb
|
|
176
177
|
- lib/ruby_reactor/map/helpers.rb
|
|
178
|
+
- lib/ruby_reactor/map/result_enumerator.rb
|
|
177
179
|
- lib/ruby_reactor/max_retries_exhausted_failure.rb
|
|
178
180
|
- lib/ruby_reactor/reactor.rb
|
|
179
181
|
- lib/ruby_reactor/registry.rb
|
|
@@ -190,6 +192,7 @@ files:
|
|
|
190
192
|
- lib/ruby_reactor/storage/configuration.rb
|
|
191
193
|
- lib/ruby_reactor/storage/redis_adapter.rb
|
|
192
194
|
- lib/ruby_reactor/template/base.rb
|
|
195
|
+
- lib/ruby_reactor/template/dynamic_source.rb
|
|
193
196
|
- lib/ruby_reactor/template/element.rb
|
|
194
197
|
- lib/ruby_reactor/template/input.rb
|
|
195
198
|
- lib/ruby_reactor/template/result.rb
|