fractor 0.1.9 → 0.1.11
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/.rubocop_todo.yml +28 -91
- data/docs/ARCHITECTURE.md +317 -0
- data/docs/PERFORMANCE_TUNING.md +355 -0
- data/docs/TROUBLESHOOTING.md +463 -0
- data/lib/fractor/callback_registry.rb +106 -0
- data/lib/fractor/config_schema.rb +170 -0
- data/lib/fractor/main_loop_handler.rb +4 -8
- data/lib/fractor/main_loop_handler3.rb +10 -12
- data/lib/fractor/main_loop_handler4.rb +48 -20
- data/lib/fractor/result_cache.rb +58 -10
- data/lib/fractor/shutdown_handler.rb +12 -6
- data/lib/fractor/supervisor.rb +100 -13
- data/lib/fractor/version.rb +1 -1
- data/lib/fractor/workflow/execution/dependency_resolver.rb +149 -0
- data/lib/fractor/workflow/execution/fallback_job_handler.rb +68 -0
- data/lib/fractor/workflow/execution/job_executor.rb +242 -0
- data/lib/fractor/workflow/execution/result_builder.rb +76 -0
- data/lib/fractor/workflow/execution/workflow_execution_logger.rb +241 -0
- data/lib/fractor/workflow/workflow_executor.rb +97 -476
- data/lib/fractor/wrapped_ractor.rb +2 -4
- data/lib/fractor.rb +11 -0
- metadata +16 -6
|
@@ -14,8 +14,7 @@ module Fractor
|
|
|
14
14
|
# @param kwargs [Hash] Additional keyword arguments for subclass initialization
|
|
15
15
|
# @return [WrappedRactor] The appropriate subclass instance
|
|
16
16
|
def self.create(name, worker_class, **kwargs)
|
|
17
|
-
|
|
18
|
-
if ruby_4_0
|
|
17
|
+
if Fractor::RUBY_4_0_OR_HIGHER
|
|
19
18
|
WrappedRactor4.new(name, worker_class, **kwargs)
|
|
20
19
|
else
|
|
21
20
|
WrappedRactor3.new(name, worker_class, **kwargs)
|
|
@@ -112,9 +111,8 @@ module Fractor
|
|
|
112
111
|
end
|
|
113
112
|
|
|
114
113
|
false
|
|
115
|
-
rescue Exception
|
|
114
|
+
rescue Exception
|
|
116
115
|
# If we get an exception, the Ractor is likely terminated
|
|
117
|
-
puts "Ractor #{@name} appears to be terminated: #{e.message}" if ENV["FRACTOR_DEBUG"]
|
|
118
116
|
@ractor = nil
|
|
119
117
|
true
|
|
120
118
|
end
|
data/lib/fractor.rb
CHANGED
|
@@ -33,6 +33,8 @@ require_relative "fractor/error_reporter"
|
|
|
33
33
|
require_relative "fractor/error_statistics"
|
|
34
34
|
require_relative "fractor/error_report_generator"
|
|
35
35
|
require_relative "fractor/error_formatter"
|
|
36
|
+
require_relative "fractor/callback_registry"
|
|
37
|
+
require_relative "fractor/config_schema"
|
|
36
38
|
require_relative "fractor/execution_tracer"
|
|
37
39
|
require_relative "fractor/result_cache"
|
|
38
40
|
|
|
@@ -46,6 +48,15 @@ end
|
|
|
46
48
|
|
|
47
49
|
# Fractor: Function-driven Ractors framework
|
|
48
50
|
module Fractor
|
|
51
|
+
# Version check constant - computed once at load time for performance
|
|
52
|
+
# Avoids expensive Gem::Version.new calls in hot paths
|
|
53
|
+
RUBY_4_0_OR_HIGHER = RUBY_VERSION >= "4.0.0"
|
|
54
|
+
|
|
55
|
+
# Windows Ruby 3.4.x check - for platform-specific workarounds
|
|
56
|
+
# This is only relevant on Windows and Ruby 3.4.x
|
|
57
|
+
WINDOWS_RUBY_34 = RUBY_PLATFORM.match?(/mswin|mingw|cygwin/) &&
|
|
58
|
+
RUBY_VERSION >= "3.4.0" && RUBY_VERSION < "3.5.0"
|
|
59
|
+
|
|
49
60
|
# Exception raised when trying to push to a closed queue
|
|
50
61
|
class ClosedQueueError < StandardError; end
|
|
51
62
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fractor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ronald Tse
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: logger
|
|
@@ -55,8 +55,11 @@ files:
|
|
|
55
55
|
- README.adoc
|
|
56
56
|
- Rakefile
|
|
57
57
|
- docs/.lycheeignore
|
|
58
|
+
- docs/ARCHITECTURE.md
|
|
58
59
|
- docs/Gemfile
|
|
60
|
+
- docs/PERFORMANCE_TUNING.md
|
|
59
61
|
- docs/README.md
|
|
62
|
+
- docs/TROUBLESHOOTING.md
|
|
60
63
|
- docs/_config.yml
|
|
61
64
|
- docs/_features/error-handling.adoc
|
|
62
65
|
- docs/_features/index.adoc
|
|
@@ -179,7 +182,9 @@ files:
|
|
|
179
182
|
- examples/workflow/simplified/simplified_workflow.rb
|
|
180
183
|
- exe/fractor
|
|
181
184
|
- lib/fractor.rb
|
|
185
|
+
- lib/fractor/callback_registry.rb
|
|
182
186
|
- lib/fractor/cli.rb
|
|
187
|
+
- lib/fractor/config_schema.rb
|
|
183
188
|
- lib/fractor/configuration.rb
|
|
184
189
|
- lib/fractor/continuous_server.rb
|
|
185
190
|
- lib/fractor/error_formatter.rb
|
|
@@ -217,6 +222,11 @@ files:
|
|
|
217
222
|
- lib/fractor/workflow/circuit_breaker_orchestrator.rb
|
|
218
223
|
- lib/fractor/workflow/circuit_breaker_registry.rb
|
|
219
224
|
- lib/fractor/workflow/dead_letter_queue.rb
|
|
225
|
+
- lib/fractor/workflow/execution/dependency_resolver.rb
|
|
226
|
+
- lib/fractor/workflow/execution/fallback_job_handler.rb
|
|
227
|
+
- lib/fractor/workflow/execution/job_executor.rb
|
|
228
|
+
- lib/fractor/workflow/execution/result_builder.rb
|
|
229
|
+
- lib/fractor/workflow/execution/workflow_execution_logger.rb
|
|
220
230
|
- lib/fractor/workflow/execution_hooks.rb
|
|
221
231
|
- lib/fractor/workflow/execution_strategy.rb
|
|
222
232
|
- lib/fractor/workflow/execution_trace.rb
|
|
@@ -239,13 +249,13 @@ files:
|
|
|
239
249
|
- lib/fractor/wrapped_ractor3.rb
|
|
240
250
|
- lib/fractor/wrapped_ractor4.rb
|
|
241
251
|
- sig/fractor.rbs
|
|
242
|
-
homepage: https://github.com/
|
|
252
|
+
homepage: https://github.com/metanorma/fractor
|
|
243
253
|
licenses: []
|
|
244
254
|
metadata:
|
|
245
255
|
allowed_push_host: https://rubygems.org
|
|
246
|
-
homepage_uri: https://github.com/
|
|
247
|
-
source_code_uri: https://github.com/
|
|
248
|
-
changelog_uri: https://github.com/
|
|
256
|
+
homepage_uri: https://github.com/metanorma/fractor
|
|
257
|
+
source_code_uri: https://github.com/metanorma/fractor
|
|
258
|
+
changelog_uri: https://github.com/metanorma/fractor/blob/main/CHANGELOG.md
|
|
249
259
|
post_install_message:
|
|
250
260
|
rdoc_options: []
|
|
251
261
|
require_paths:
|