fractor 0.1.6 → 0.1.7

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.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +227 -102
  3. data/README.adoc +113 -1940
  4. data/docs/.lycheeignore +16 -0
  5. data/docs/Gemfile +24 -0
  6. data/docs/README.md +157 -0
  7. data/docs/_config.yml +151 -0
  8. data/docs/_features/error-handling.adoc +1192 -0
  9. data/docs/_features/index.adoc +80 -0
  10. data/docs/_features/monitoring.adoc +589 -0
  11. data/docs/_features/signal-handling.adoc +202 -0
  12. data/docs/_features/workflows.adoc +1235 -0
  13. data/docs/_guides/continuous-mode.adoc +736 -0
  14. data/docs/_guides/cookbook.adoc +1133 -0
  15. data/docs/_guides/index.adoc +55 -0
  16. data/docs/_guides/pipeline-mode.adoc +730 -0
  17. data/docs/_guides/troubleshooting.adoc +358 -0
  18. data/docs/_pages/architecture.adoc +1390 -0
  19. data/docs/_pages/core-concepts.adoc +1392 -0
  20. data/docs/_pages/design-principles.adoc +862 -0
  21. data/docs/_pages/getting-started.adoc +290 -0
  22. data/docs/_pages/installation.adoc +143 -0
  23. data/docs/_reference/api.adoc +1080 -0
  24. data/docs/_reference/error-reporting.adoc +670 -0
  25. data/docs/_reference/examples.adoc +181 -0
  26. data/docs/_reference/index.adoc +96 -0
  27. data/docs/_reference/troubleshooting.adoc +862 -0
  28. data/docs/_tutorials/complex-workflows.adoc +1022 -0
  29. data/docs/_tutorials/data-processing-pipeline.adoc +740 -0
  30. data/docs/_tutorials/first-application.adoc +384 -0
  31. data/docs/_tutorials/index.adoc +48 -0
  32. data/docs/_tutorials/long-running-services.adoc +931 -0
  33. data/docs/assets/images/favicon-16.png +0 -0
  34. data/docs/assets/images/favicon-32.png +0 -0
  35. data/docs/assets/images/favicon-48.png +0 -0
  36. data/docs/assets/images/favicon.ico +0 -0
  37. data/docs/assets/images/favicon.png +0 -0
  38. data/docs/assets/images/favicon.svg +45 -0
  39. data/docs/assets/images/fractor-icon.svg +49 -0
  40. data/docs/assets/images/fractor-logo.svg +61 -0
  41. data/docs/index.adoc +131 -0
  42. data/docs/lychee.toml +39 -0
  43. data/examples/api_aggregator/README.adoc +627 -0
  44. data/examples/api_aggregator/api_aggregator.rb +376 -0
  45. data/examples/auto_detection/README.adoc +407 -29
  46. data/examples/continuous_chat_common/message_protocol.rb +1 -1
  47. data/examples/error_reporting.rb +207 -0
  48. data/examples/file_processor/README.adoc +170 -0
  49. data/examples/file_processor/file_processor.rb +615 -0
  50. data/examples/file_processor/sample_files/invalid.csv +1 -0
  51. data/examples/file_processor/sample_files/orders.xml +24 -0
  52. data/examples/file_processor/sample_files/products.json +23 -0
  53. data/examples/file_processor/sample_files/users.csv +6 -0
  54. data/examples/hierarchical_hasher/README.adoc +629 -41
  55. data/examples/image_processor/README.adoc +610 -0
  56. data/examples/image_processor/image_processor.rb +349 -0
  57. data/examples/image_processor/processed_images/sample_10_processed.jpg.json +12 -0
  58. data/examples/image_processor/processed_images/sample_1_processed.jpg.json +12 -0
  59. data/examples/image_processor/processed_images/sample_2_processed.jpg.json +12 -0
  60. data/examples/image_processor/processed_images/sample_3_processed.jpg.json +12 -0
  61. data/examples/image_processor/processed_images/sample_4_processed.jpg.json +12 -0
  62. data/examples/image_processor/processed_images/sample_5_processed.jpg.json +12 -0
  63. data/examples/image_processor/processed_images/sample_6_processed.jpg.json +12 -0
  64. data/examples/image_processor/processed_images/sample_7_processed.jpg.json +12 -0
  65. data/examples/image_processor/processed_images/sample_8_processed.jpg.json +12 -0
  66. data/examples/image_processor/processed_images/sample_9_processed.jpg.json +12 -0
  67. data/examples/image_processor/test_images/sample_1.png +1 -0
  68. data/examples/image_processor/test_images/sample_10.png +1 -0
  69. data/examples/image_processor/test_images/sample_2.png +1 -0
  70. data/examples/image_processor/test_images/sample_3.png +1 -0
  71. data/examples/image_processor/test_images/sample_4.png +1 -0
  72. data/examples/image_processor/test_images/sample_5.png +1 -0
  73. data/examples/image_processor/test_images/sample_6.png +1 -0
  74. data/examples/image_processor/test_images/sample_7.png +1 -0
  75. data/examples/image_processor/test_images/sample_8.png +1 -0
  76. data/examples/image_processor/test_images/sample_9.png +1 -0
  77. data/examples/log_analyzer/README.adoc +662 -0
  78. data/examples/log_analyzer/log_analyzer.rb +579 -0
  79. data/examples/log_analyzer/sample_logs/apache.log +20 -0
  80. data/examples/log_analyzer/sample_logs/json.log +15 -0
  81. data/examples/log_analyzer/sample_logs/nginx.log +15 -0
  82. data/examples/log_analyzer/sample_logs/rails.log +29 -0
  83. data/examples/multi_work_type/README.adoc +576 -26
  84. data/examples/performance_monitoring.rb +120 -0
  85. data/examples/pipeline_processing/README.adoc +740 -26
  86. data/examples/pipeline_processing/pipeline_processing.rb +2 -2
  87. data/examples/priority_work_example.rb +155 -0
  88. data/examples/producer_subscriber/README.adoc +889 -46
  89. data/examples/scatter_gather/README.adoc +829 -27
  90. data/examples/simple/README.adoc +347 -0
  91. data/examples/specialized_workers/README.adoc +622 -26
  92. data/examples/specialized_workers/specialized_workers.rb +44 -8
  93. data/examples/stream_processor/README.adoc +206 -0
  94. data/examples/stream_processor/stream_processor.rb +284 -0
  95. data/examples/web_scraper/README.adoc +625 -0
  96. data/examples/web_scraper/web_scraper.rb +285 -0
  97. data/examples/workflow/README.adoc +406 -0
  98. data/examples/workflow/circuit_breaker/README.adoc +360 -0
  99. data/examples/workflow/circuit_breaker/circuit_breaker_workflow.rb +225 -0
  100. data/examples/workflow/conditional/README.adoc +483 -0
  101. data/examples/workflow/conditional/conditional_workflow.rb +215 -0
  102. data/examples/workflow/dead_letter_queue/README.adoc +374 -0
  103. data/examples/workflow/dead_letter_queue/dead_letter_queue_workflow.rb +217 -0
  104. data/examples/workflow/fan_out/README.adoc +381 -0
  105. data/examples/workflow/fan_out/fan_out_workflow.rb +202 -0
  106. data/examples/workflow/retry/README.adoc +248 -0
  107. data/examples/workflow/retry/retry_workflow.rb +195 -0
  108. data/examples/workflow/simple_linear/README.adoc +267 -0
  109. data/examples/workflow/simple_linear/simple_linear_workflow.rb +175 -0
  110. data/examples/workflow/simplified/README.adoc +329 -0
  111. data/examples/workflow/simplified/simplified_workflow.rb +222 -0
  112. data/exe/fractor +10 -0
  113. data/lib/fractor/cli.rb +288 -0
  114. data/lib/fractor/configuration.rb +307 -0
  115. data/lib/fractor/continuous_server.rb +60 -65
  116. data/lib/fractor/error_formatter.rb +72 -0
  117. data/lib/fractor/error_report_generator.rb +152 -0
  118. data/lib/fractor/error_reporter.rb +244 -0
  119. data/lib/fractor/error_statistics.rb +147 -0
  120. data/lib/fractor/execution_tracer.rb +162 -0
  121. data/lib/fractor/logger.rb +230 -0
  122. data/lib/fractor/main_loop_handler.rb +406 -0
  123. data/lib/fractor/main_loop_handler3.rb +135 -0
  124. data/lib/fractor/main_loop_handler4.rb +299 -0
  125. data/lib/fractor/performance_metrics_collector.rb +181 -0
  126. data/lib/fractor/performance_monitor.rb +215 -0
  127. data/lib/fractor/performance_report_generator.rb +202 -0
  128. data/lib/fractor/priority_work.rb +93 -0
  129. data/lib/fractor/priority_work_queue.rb +189 -0
  130. data/lib/fractor/result_aggregator.rb +32 -0
  131. data/lib/fractor/shutdown_handler.rb +168 -0
  132. data/lib/fractor/signal_handler.rb +80 -0
  133. data/lib/fractor/supervisor.rb +382 -269
  134. data/lib/fractor/supervisor_logger.rb +88 -0
  135. data/lib/fractor/version.rb +1 -1
  136. data/lib/fractor/work.rb +12 -0
  137. data/lib/fractor/work_distribution_manager.rb +151 -0
  138. data/lib/fractor/work_queue.rb +20 -0
  139. data/lib/fractor/work_result.rb +181 -9
  140. data/lib/fractor/worker.rb +73 -0
  141. data/lib/fractor/workflow/builder.rb +210 -0
  142. data/lib/fractor/workflow/chain_builder.rb +169 -0
  143. data/lib/fractor/workflow/circuit_breaker.rb +183 -0
  144. data/lib/fractor/workflow/circuit_breaker_orchestrator.rb +208 -0
  145. data/lib/fractor/workflow/circuit_breaker_registry.rb +112 -0
  146. data/lib/fractor/workflow/dead_letter_queue.rb +334 -0
  147. data/lib/fractor/workflow/execution_hooks.rb +39 -0
  148. data/lib/fractor/workflow/execution_strategy.rb +225 -0
  149. data/lib/fractor/workflow/execution_trace.rb +134 -0
  150. data/lib/fractor/workflow/helpers.rb +191 -0
  151. data/lib/fractor/workflow/job.rb +290 -0
  152. data/lib/fractor/workflow/job_dependency_validator.rb +120 -0
  153. data/lib/fractor/workflow/logger.rb +110 -0
  154. data/lib/fractor/workflow/pre_execution_context.rb +193 -0
  155. data/lib/fractor/workflow/retry_config.rb +156 -0
  156. data/lib/fractor/workflow/retry_orchestrator.rb +184 -0
  157. data/lib/fractor/workflow/retry_strategy.rb +93 -0
  158. data/lib/fractor/workflow/structured_logger.rb +30 -0
  159. data/lib/fractor/workflow/type_compatibility_validator.rb +222 -0
  160. data/lib/fractor/workflow/visualizer.rb +211 -0
  161. data/lib/fractor/workflow/workflow_context.rb +132 -0
  162. data/lib/fractor/workflow/workflow_executor.rb +669 -0
  163. data/lib/fractor/workflow/workflow_result.rb +55 -0
  164. data/lib/fractor/workflow/workflow_validator.rb +295 -0
  165. data/lib/fractor/workflow.rb +333 -0
  166. data/lib/fractor/wrapped_ractor.rb +66 -101
  167. data/lib/fractor/wrapped_ractor3.rb +161 -0
  168. data/lib/fractor/wrapped_ractor4.rb +242 -0
  169. data/lib/fractor.rb +92 -4
  170. metadata +179 -6
  171. data/tests/sample.rb.bak +0 -309
  172. data/tests/sample_working.rb.bak +0 -209
@@ -0,0 +1,16 @@
1
+ # Ignore localhost links (used in examples)
2
+ http://localhost
3
+ https://localhost
4
+
5
+ # Ignore relative links (checked by Jekyll)
6
+ file://
7
+
8
+ # Ignore example domains
9
+ https://api.example.com
10
+ http://example.com
11
+ https://example.com
12
+
13
+ # Ignore GitHub commit/issue placeholders
14
+ https://github.com/*/*/issues/#
15
+ https://github.com/*/*/pull/#
16
+ https://github.com/*/*/commit/#
data/docs/Gemfile ADDED
@@ -0,0 +1,24 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "jekyll", "~> 4.3"
4
+ gem "just-the-docs", "~> 0.7"
5
+
6
+ group :jekyll_plugins do
7
+ gem "jekyll-asciidoc"
8
+ gem "jekyll-seo-tag"
9
+ gem "jekyll-sitemap"
10
+ end
11
+
12
+ # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
13
+ # and associated library.
14
+ platforms :mingw, :x64_mingw, :mswin, :jruby do
15
+ gem "tzinfo", ">= 1", "< 3"
16
+ gem "tzinfo-data"
17
+ end
18
+
19
+ # Performance-booster for watching directories on Windows
20
+ gem "wdm", "~> 0.1", platforms: %i[mingw x64_mingw mswin]
21
+
22
+ # Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
23
+ # do not have a Java counterpart.
24
+ gem "http_parser.rb", "~> 0.6.0", platforms: [:jruby]
data/docs/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # Fractor Documentation
2
+
3
+ This directory contains the documentation for Fractor, built with Jekyll and the just-the-docs theme.
4
+
5
+ ## Building Locally
6
+
7
+ ### Prerequisites
8
+
9
+ - Ruby 3.0 or later
10
+ - Bundler (`gem install bundler`)
11
+
12
+ ### Setup
13
+
14
+ Install dependencies:
15
+
16
+ ```bash
17
+ cd docs
18
+ bundle install
19
+ ```
20
+
21
+ ### Development Server
22
+
23
+ Run the Jekyll development server:
24
+
25
+ ```bash
26
+ cd docs
27
+ bundle install
28
+ bundle exec jekyll serve --livereload --baseurl /fractor
29
+ ```
30
+
31
+ Then visit http://localhost:4000/fractor in your browser.
32
+
33
+ The `--livereload` option enables automatic page refresh when files change.
34
+ The `--baseurl /fractor` option matches the GitHub Pages deployment URL.
35
+
36
+ ### Building for Production
37
+
38
+ Build the static site:
39
+
40
+ ```bash
41
+ bundle exec jekyll build
42
+ ```
43
+
44
+ The generated site will be in `_site/`.
45
+
46
+ ## Link Checking
47
+
48
+ This documentation uses [lychee](https://github.com/lycheeverse/lychee) for link validation.
49
+
50
+ ### Install lychee
51
+
52
+ ```bash
53
+ # macOS
54
+ brew install lychee
55
+
56
+ # Cargo (all platforms)
57
+ cargo install lychee
58
+
59
+ # Or download binary from releases
60
+ ```
61
+
62
+ ### Run link checker
63
+
64
+ Check all links in the documentation:
65
+
66
+ ```bash
67
+ lychee docs/
68
+ ```
69
+
70
+ Or check the built site:
71
+
72
+ ```bash
73
+ lychee _site/
74
+ ```
75
+
76
+ Configuration is in `lychee.toml` and `.lycheeignore`.
77
+
78
+ ## Documentation Structure
79
+
80
+ The documentation follows an onion structure from beginner to advanced:
81
+
82
+ ```
83
+ docs/
84
+ ├── index.md # Landing page
85
+ ├── _tutorials/ # Beginner guides
86
+ │ ├── index.md
87
+ │ ├── installation.adoc
88
+ │ ├── first-application.adoc
89
+ │ └── getting-started.adoc
90
+ ├── _guides/ # Intermediate topics
91
+ │ ├── index.md
92
+ │ ├── core-concepts.adoc
93
+ │ ├── pipeline-mode.adoc
94
+ │ ├── continuous-mode.adoc
95
+ │ ├── workflows.adoc
96
+ │ ├── error-reporting.adoc
97
+ │ └── signal-handling.adoc
98
+ └── _reference/ # Advanced/API reference
99
+ ├── index.md
100
+ ├── api.adoc
101
+ ├── examples.adoc
102
+ └── patterns.adoc
103
+ ```
104
+
105
+ ## Writing Documentation
106
+
107
+ ### Front Matter
108
+
109
+ All documentation files must include YAML front matter:
110
+
111
+ ```yaml
112
+ ---
113
+ layout: default
114
+ title: Page Title
115
+ parent: Parent Section
116
+ nav_order: 1
117
+ ---
118
+ ```
119
+
120
+ ### AsciiDoc Files
121
+
122
+ AsciiDoc files should:
123
+ - Start with level 2 headings (`==`) not level 1 (`=`)
124
+ - Use proper heading hierarchy
125
+ - Include code syntax highlighting with `[source,language]`
126
+
127
+ ### Markdown Files
128
+
129
+ Markdown files should:
130
+ - Use `#` for headings (Jekyll will handle levels)
131
+ - Use fenced code blocks with language tags
132
+ - Follow just-the-docs conventions
133
+
134
+ ### Navigation
135
+
136
+ Navigation is automatically generated from:
137
+ - Front matter `nav_order` values
138
+ - Collection configuration in `_config.yml`
139
+ - Directory structure
140
+
141
+ ## Contributing
142
+
143
+ When adding new documentation:
144
+
145
+ 1. Choose the appropriate section (tutorials/guides/reference)
146
+ 2. Add proper front matter
147
+ 3. Use consistent heading levels
148
+ 4. Add code examples where relevant
149
+ 5. Test locally with `bundle exec jekyll serve`
150
+ 6. Run link checker: `lychee docs/`
151
+ 7. Submit a pull request
152
+
153
+ ## Deployment
154
+
155
+ Documentation is automatically deployed to GitHub Pages when changes are merged to the main branch.
156
+
157
+ Site URL: https://metanorma.github.io/fractor
data/docs/_config.yml ADDED
@@ -0,0 +1,151 @@
1
+ # Site settings
2
+ title: Fractor
3
+ description: >-
4
+ Parallel processing framework for Ruby using Ractors
5
+ baseurl: "/fractor"
6
+ url: "https://metanorma.github.io"
7
+
8
+ # Theme
9
+ theme: just-the-docs
10
+ remote_theme: just-the-docs/just-the-docs@v0.7.0
11
+
12
+ # Logo
13
+ logo: "/assets/images/fractor-logo.svg"
14
+ favicon_ico: "/assets/images/favicon.ico"
15
+
16
+ # Color scheme
17
+ color_scheme: light
18
+
19
+ # Search
20
+ search_enabled: true
21
+ search:
22
+ heading_level: 2
23
+ previews: 3
24
+ preview_words_before: 5
25
+ preview_words_after: 10
26
+ tokenizer_separator: /[\s/]+/
27
+ rel_url: true
28
+ button: false
29
+
30
+ # Heading anchors
31
+ heading_anchors: true
32
+
33
+ # Aux links for the upper right navigation
34
+ aux_links:
35
+ "GitHub":
36
+ - "https://github.com/metanorma/fractor"
37
+ "RubyGems":
38
+ - "https://rubygems.org/gems/fractor"
39
+
40
+ # Makes Aux links open in a new tab
41
+ aux_links_new_tab: true
42
+
43
+ # Back to top link
44
+ back_to_top: true
45
+ back_to_top_text: "Back to top"
46
+
47
+ # Footer content
48
+ footer_content: >-
49
+ Copyright &copy; 2025 Ribose. Distributed by an
50
+ <a href="https://github.com/metanorma/fractor/blob/main/LICENSE">MIT license</a>.
51
+
52
+ # Footer last edit timestamp
53
+ last_edit_timestamp: true
54
+ last_edit_time_format: "%b %e %Y at %I:%M %p"
55
+
56
+ # Navigation structure
57
+ nav_sort: order
58
+
59
+ # Collections for organizing content
60
+ collections:
61
+ pages:
62
+ permalink: "/:path/"
63
+ output: true
64
+ tutorials:
65
+ permalink: "/:collection/:path/"
66
+ output: true
67
+ guides:
68
+ permalink: "/:collection/:path/"
69
+ output: true
70
+ features:
71
+ permalink: "/:collection/:path/"
72
+ output: true
73
+ reference:
74
+ permalink: "/:collection/:path/"
75
+ output: true
76
+
77
+ # Just the Docs collection configuration
78
+ just_the_docs:
79
+ collections:
80
+ pages:
81
+ name: Core topics
82
+ nav_fold: false
83
+ tutorials:
84
+ name: Tutorials
85
+ nav_fold: true
86
+ guides:
87
+ name: Guides
88
+ nav_fold: true
89
+ features:
90
+ name: Features
91
+ nav_fold: true
92
+ reference:
93
+ name: Reference
94
+ nav_fold: true
95
+
96
+ # Plugins
97
+ plugins:
98
+ - jekyll-asciidoc
99
+ - jekyll-seo-tag
100
+ - jekyll-sitemap
101
+
102
+ # AsciiDoc configuration
103
+ asciidoc: {}
104
+ asciidoctor:
105
+ attributes:
106
+ - source-highlighter=rouge
107
+ - rouge-style=github
108
+ - icons=font
109
+ - sectanchors=true
110
+ - idprefix=
111
+ - idseparator=-
112
+ - experimental=true
113
+
114
+ include:
115
+ - '*.adoc'
116
+
117
+ # Exclude from processing
118
+ exclude:
119
+ - Gemfile
120
+ - Gemfile.lock
121
+ - node_modules
122
+ - vendor/bundle/
123
+ - vendor/cache/
124
+ - vendor/gems/
125
+ - vendor/ruby/
126
+ - "*.gem"
127
+ - "*.gemspec"
128
+ - tools/
129
+ - README.md
130
+ - Rakefile
131
+
132
+ # Enable code copy button
133
+ enable_copy_code_button: true
134
+
135
+ # Callouts
136
+ callouts_level: quiet
137
+ callouts:
138
+ highlight:
139
+ color: yellow
140
+ important:
141
+ title: Important
142
+ color: blue
143
+ new:
144
+ title: New
145
+ color: green
146
+ note:
147
+ title: Note
148
+ color: purple
149
+ warning:
150
+ title: Warning
151
+ color: red