simple_flow 0.1.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.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/.envrc +1 -0
  3. data/.github/workflows/deploy-github-pages.yml +52 -0
  4. data/.rubocop.yml +57 -0
  5. data/CHANGELOG.md +4 -0
  6. data/COMMITS.md +196 -0
  7. data/LICENSE +21 -0
  8. data/README.md +481 -0
  9. data/Rakefile +15 -0
  10. data/benchmarks/parallel_vs_sequential.rb +98 -0
  11. data/benchmarks/pipeline_overhead.rb +130 -0
  12. data/docs/api/middleware.md +468 -0
  13. data/docs/api/parallel-step.md +363 -0
  14. data/docs/api/pipeline.md +382 -0
  15. data/docs/api/result.md +375 -0
  16. data/docs/concurrent/best-practices.md +687 -0
  17. data/docs/concurrent/introduction.md +246 -0
  18. data/docs/concurrent/parallel-steps.md +418 -0
  19. data/docs/concurrent/performance.md +481 -0
  20. data/docs/core-concepts/flow-control.md +452 -0
  21. data/docs/core-concepts/middleware.md +389 -0
  22. data/docs/core-concepts/overview.md +219 -0
  23. data/docs/core-concepts/pipeline.md +315 -0
  24. data/docs/core-concepts/result.md +168 -0
  25. data/docs/core-concepts/steps.md +391 -0
  26. data/docs/development/benchmarking.md +443 -0
  27. data/docs/development/contributing.md +380 -0
  28. data/docs/development/dagwood-concepts.md +435 -0
  29. data/docs/development/testing.md +514 -0
  30. data/docs/getting-started/examples.md +197 -0
  31. data/docs/getting-started/installation.md +62 -0
  32. data/docs/getting-started/quick-start.md +218 -0
  33. data/docs/guides/choosing-concurrency-model.md +441 -0
  34. data/docs/guides/complex-workflows.md +440 -0
  35. data/docs/guides/data-fetching.md +478 -0
  36. data/docs/guides/error-handling.md +635 -0
  37. data/docs/guides/file-processing.md +505 -0
  38. data/docs/guides/validation-patterns.md +496 -0
  39. data/docs/index.md +169 -0
  40. data/examples/.gitignore +3 -0
  41. data/examples/01_basic_pipeline.rb +112 -0
  42. data/examples/02_error_handling.rb +178 -0
  43. data/examples/03_middleware.rb +186 -0
  44. data/examples/04_parallel_automatic.rb +221 -0
  45. data/examples/05_parallel_explicit.rb +279 -0
  46. data/examples/06_real_world_ecommerce.rb +288 -0
  47. data/examples/07_real_world_etl.rb +277 -0
  48. data/examples/08_graph_visualization.rb +246 -0
  49. data/examples/09_pipeline_visualization.rb +266 -0
  50. data/examples/10_concurrency_control.rb +235 -0
  51. data/examples/11_sequential_dependencies.rb +243 -0
  52. data/examples/12_none_constant.rb +161 -0
  53. data/examples/README.md +374 -0
  54. data/examples/regression_test/01_basic_pipeline.txt +38 -0
  55. data/examples/regression_test/02_error_handling.txt +92 -0
  56. data/examples/regression_test/03_middleware.txt +61 -0
  57. data/examples/regression_test/04_parallel_automatic.txt +86 -0
  58. data/examples/regression_test/05_parallel_explicit.txt +80 -0
  59. data/examples/regression_test/06_real_world_ecommerce.txt +53 -0
  60. data/examples/regression_test/07_real_world_etl.txt +58 -0
  61. data/examples/regression_test/08_graph_visualization.txt +429 -0
  62. data/examples/regression_test/09_pipeline_visualization.txt +305 -0
  63. data/examples/regression_test/10_concurrency_control.txt +96 -0
  64. data/examples/regression_test/11_sequential_dependencies.txt +86 -0
  65. data/examples/regression_test/12_none_constant.txt +64 -0
  66. data/examples/regression_test.rb +105 -0
  67. data/lib/simple_flow/dependency_graph.rb +120 -0
  68. data/lib/simple_flow/dependency_graph_visualizer.rb +326 -0
  69. data/lib/simple_flow/middleware.rb +36 -0
  70. data/lib/simple_flow/parallel_executor.rb +80 -0
  71. data/lib/simple_flow/pipeline.rb +405 -0
  72. data/lib/simple_flow/result.rb +88 -0
  73. data/lib/simple_flow/step_tracker.rb +58 -0
  74. data/lib/simple_flow/version.rb +5 -0
  75. data/lib/simple_flow.rb +41 -0
  76. data/mkdocs.yml +146 -0
  77. data/pipeline_graph.dot +51 -0
  78. data/pipeline_graph.html +60 -0
  79. data/pipeline_graph.mmd +19 -0
  80. metadata +127 -0
data/mkdocs.yml ADDED
@@ -0,0 +1,146 @@
1
+ site_name: SimpleFlow Documentation
2
+ site_description: "A lightweight, modular Ruby framework for building composable data processing pipelines with concurrent execution"
3
+ site_author: "Dewayne VanHoozer"
4
+ site_url: "https://madbomber.github.io/simple_flow/"
5
+
6
+ repo_name: "MadBomber/simple_flow"
7
+ repo_url: "https://github.com/MadBomber/simple_flow"
8
+ edit_uri: "edit/main/docs/"
9
+
10
+ theme:
11
+ name: material
12
+ language: en
13
+ favicon: assets/logo.png
14
+
15
+ palette:
16
+ - media: "(prefers-color-scheme: light)"
17
+ scheme: default
18
+ primary: indigo
19
+ accent: deep-purple
20
+ toggle:
21
+ icon: material/brightness-7
22
+ name: Switch to dark mode
23
+
24
+ - media: "(prefers-color-scheme: dark)"
25
+ scheme: slate
26
+ primary: indigo
27
+ accent: deep-purple
28
+ toggle:
29
+ icon: material/brightness-4
30
+ name: Switch to light mode
31
+
32
+ font:
33
+ text: Roboto
34
+ code: Roboto Mono
35
+
36
+ features:
37
+ - navigation.instant
38
+ - navigation.tracking
39
+ - navigation.tabs
40
+ - navigation.tabs.sticky
41
+ - navigation.sections
42
+ - navigation.path
43
+ - navigation.indexes
44
+ - navigation.top
45
+ - toc.follow
46
+ - search.suggest
47
+ - search.highlight
48
+ - search.share
49
+ - header.autohide
50
+ - content.code.copy
51
+ - content.code.annotate
52
+ - content.tabs.link
53
+ - content.tooltips
54
+ - content.action.edit
55
+ - content.action.view
56
+
57
+ plugins:
58
+ - search:
59
+ separator: '[\s\-,:!=\[\]()"\`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
60
+
61
+ markdown_extensions:
62
+ - abbr
63
+ - admonition
64
+ - attr_list
65
+ - def_list
66
+ - footnotes
67
+ - md_in_html
68
+ - toc:
69
+ permalink: true
70
+ title: On this page
71
+ - pymdownx.arithmatex:
72
+ generic: true
73
+ - pymdownx.betterem:
74
+ smart_enable: all
75
+ - pymdownx.caret
76
+ - pymdownx.details
77
+ - pymdownx.emoji:
78
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
79
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
80
+ - pymdownx.highlight:
81
+ anchor_linenums: true
82
+ line_spans: __span
83
+ pygments_lang_class: true
84
+ - pymdownx.inlinehilite
85
+ - pymdownx.keys
86
+ - pymdownx.magiclink:
87
+ repo_url_shorthand: true
88
+ user: MadBomber
89
+ repo: simple_flow
90
+ - pymdownx.mark
91
+ - pymdownx.smartsymbols
92
+ - pymdownx.superfences:
93
+ custom_fences:
94
+ - name: mermaid
95
+ class: mermaid
96
+ format: !!python/name:pymdownx.superfences.fence_code_format
97
+ - pymdownx.tabbed:
98
+ alternate_style: true
99
+ - pymdownx.tasklist:
100
+ custom_checkbox: true
101
+ - pymdownx.tilde
102
+
103
+ extra:
104
+ version: 0.0.1
105
+ social:
106
+ - icon: fontawesome/brands/github
107
+ link: https://github.com/MadBomber/simple_flow
108
+ name: GitHub Repository
109
+ generator: false
110
+
111
+ nav:
112
+ - Home: index.md
113
+ - 🚀 Getting Started:
114
+ - Installation: getting-started/installation.md
115
+ - Quick Start: getting-started/quick-start.md
116
+ - Examples: getting-started/examples.md
117
+ - 📖 Core Concepts:
118
+ - Overview: core-concepts/overview.md
119
+ - Result: core-concepts/result.md
120
+ - Pipeline: core-concepts/pipeline.md
121
+ - Steps: core-concepts/steps.md
122
+ - Middleware: core-concepts/middleware.md
123
+ - Flow Control: core-concepts/flow-control.md
124
+ - ⚡ Concurrent Execution:
125
+ - Introduction: concurrent/introduction.md
126
+ - Parallel Steps: concurrent/parallel-steps.md
127
+ - Performance: concurrent/performance.md
128
+ - Best Practices: concurrent/best-practices.md
129
+ - 📚 Guides:
130
+ - Error Handling: guides/error-handling.md
131
+ - Validation Patterns: guides/validation-patterns.md
132
+ - Choosing Concurrency Model: guides/choosing-concurrency-model.md
133
+ - Data Fetching: guides/data-fetching.md
134
+ - File Processing: guides/file-processing.md
135
+ - Complex Workflows: guides/complex-workflows.md
136
+ - 🔌 API Reference:
137
+ - Result API: api/result.md
138
+ - Pipeline API: api/pipeline.md
139
+ - ParallelStep API: api/parallel-step.md
140
+ - Middleware API: api/middleware.md
141
+ - ⚙️ Development:
142
+ - Contributing: development/contributing.md
143
+ - Testing: development/testing.md
144
+ - Benchmarking: development/benchmarking.md
145
+
146
+ copyright: Copyright © 2025 Dewayne VanHoozer
@@ -0,0 +1,51 @@
1
+ digraph DependencyGraph {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded];
4
+
5
+ // Group 1
6
+ validate_order [fillcolor=lightblue, style="rounded,filled"];
7
+ // Group 2
8
+ calculate_shipping [fillcolor=lightgreen, style="rounded,filled"];
9
+ check_inventory [fillcolor=lightgreen, style="rounded,filled"];
10
+ // Group 3
11
+ calculate_totals [fillcolor=lightyellow, style="rounded,filled"];
12
+ // Group 4
13
+ process_payment [fillcolor=lightpink, style="rounded,filled"];
14
+ // Group 5
15
+ reserve_inventory [fillcolor=lightgray, style="rounded,filled"];
16
+ // Group 6
17
+ create_shipment [fillcolor=lightblue, style="rounded,filled"];
18
+ // Group 7
19
+ send_email [fillcolor=lightgreen, style="rounded,filled"];
20
+ send_sms [fillcolor=lightgreen, style="rounded,filled"];
21
+ // Group 8
22
+ finalize_order [fillcolor=lightyellow, style="rounded,filled"];
23
+
24
+ // Dependencies
25
+ validate_order;
26
+ validate_order -> check_inventory;
27
+ validate_order -> calculate_shipping;
28
+ calculate_shipping -> calculate_totals;
29
+ check_inventory -> calculate_totals;
30
+ calculate_totals -> process_payment;
31
+ process_payment -> reserve_inventory;
32
+ reserve_inventory -> create_shipment;
33
+ create_shipment -> send_email;
34
+ create_shipment -> send_sms;
35
+ send_email -> finalize_order;
36
+ send_sms -> finalize_order;
37
+
38
+ // Legend
39
+ subgraph cluster_legend {
40
+ label="Parallel Groups";
41
+ style=dashed;
42
+ legend_0 [label="Group 1 (1 step)", fillcolor=lightblue, style="rounded,filled"];
43
+ legend_1 [label="Group 2 (2 steps)", fillcolor=lightgreen, style="rounded,filled"];
44
+ legend_2 [label="Group 3 (1 step)", fillcolor=lightyellow, style="rounded,filled"];
45
+ legend_3 [label="Group 4 (1 step)", fillcolor=lightpink, style="rounded,filled"];
46
+ legend_4 [label="Group 5 (1 step)", fillcolor=lightgray, style="rounded,filled"];
47
+ legend_5 [label="Group 6 (1 step)", fillcolor=lightblue, style="rounded,filled"];
48
+ legend_6 [label="Group 7 (2 steps)", fillcolor=lightgreen, style="rounded,filled"];
49
+ legend_7 [label="Group 8 (1 step)", fillcolor=lightyellow, style="rounded,filled"];
50
+ }
51
+ }
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>E-commerce Pipeline</title>
5
+ <script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script>
6
+ <style>
7
+ body { font-family: Arial, sans-serif; margin: 20px; }
8
+ #graph { width: 100%; height: 600px; border: 1px solid #ddd; }
9
+ .info { margin-top: 20px; padding: 15px; background: #f5f5f5; border-radius: 5px; }
10
+ .legend { display: flex; gap: 20px; margin-top: 10px; }
11
+ .legend-item { display: flex; align-items: center; gap: 5px; }
12
+ .legend-color { width: 20px; height: 20px; border-radius: 3px; }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <h1>E-commerce Pipeline</h1>
17
+ <div id="graph"></div>
18
+ <div class="info">
19
+ <h3>Execution Groups (Parallel)</h3>
20
+ <div class="legend">
21
+ <div class='legend-item'><div class='legend-color' style='background: #A8D5FF'></div><span>Group 1: validate_order</span></div>
22
+ <div class='legend-item'><div class='legend-color' style='background: #A8FFA8'></div><span>Group 2: calculate_shipping, check_inventory</span></div>
23
+ <div class='legend-item'><div class='legend-color' style='background: #FFFFA8'></div><span>Group 3: calculate_totals</span></div>
24
+ <div class='legend-item'><div class='legend-color' style='background: #FFA8FF'></div><span>Group 4: process_payment</span></div>
25
+ <div class='legend-item'><div class='legend-color' style='background: #D3D3D3'></div><span>Group 5: reserve_inventory</span></div>
26
+ <div class='legend-item'><div class='legend-color' style='background: #A8D5FF'></div><span>Group 6: create_shipment</span></div>
27
+ <div class='legend-item'><div class='legend-color' style='background: #A8FFA8'></div><span>Group 7: send_email, send_sms</span></div>
28
+ <div class='legend-item'><div class='legend-color' style='background: #FFFFA8'></div><span>Group 8: finalize_order</span></div>
29
+ </div>
30
+ </div>
31
+ <script>
32
+ var nodes = new vis.DataSet([{"id":"validate_order","label":"validate_order","color":"#A8D5FF","level":0},{"id":"check_inventory","label":"check_inventory","color":"#A8FFA8","level":1},{"id":"calculate_shipping","label":"calculate_shipping","color":"#A8FFA8","level":1},{"id":"calculate_totals","label":"calculate_totals","color":"#FFFFA8","level":2},{"id":"process_payment","label":"process_payment","color":"#FFA8FF","level":3},{"id":"reserve_inventory","label":"reserve_inventory","color":"#D3D3D3","level":4},{"id":"create_shipment","label":"create_shipment","color":"#A8D5FF","level":5},{"id":"send_email","label":"send_email","color":"#A8FFA8","level":6},{"id":"send_sms","label":"send_sms","color":"#A8FFA8","level":6},{"id":"finalize_order","label":"finalize_order","color":"#FFFFA8","level":7}]);
33
+ var edges = new vis.DataSet([{"from":"validate_order","to":"check_inventory"},{"from":"validate_order","to":"calculate_shipping"},{"from":"calculate_shipping","to":"calculate_totals"},{"from":"check_inventory","to":"calculate_totals"},{"from":"calculate_totals","to":"process_payment"},{"from":"process_payment","to":"reserve_inventory"},{"from":"reserve_inventory","to":"create_shipment"},{"from":"create_shipment","to":"send_email"},{"from":"create_shipment","to":"send_sms"},{"from":"send_email","to":"finalize_order"},{"from":"send_sms","to":"finalize_order"}]);
34
+ var container = document.getElementById('graph');
35
+ var data = { nodes: nodes, edges: edges };
36
+ var options = {
37
+ layout: {
38
+ hierarchical: {
39
+ direction: 'UD',
40
+ sortMethod: 'directed',
41
+ levelSeparation: 150
42
+ }
43
+ },
44
+ edges: {
45
+ arrows: 'to',
46
+ smooth: { type: 'cubicBezier' }
47
+ },
48
+ nodes: {
49
+ shape: 'box',
50
+ margin: 10,
51
+ widthConstraint: { minimum: 100, maximum: 200 }
52
+ },
53
+ physics: {
54
+ enabled: false
55
+ }
56
+ };
57
+ var network = new vis.Network(container, data, options);
58
+ </script>
59
+ </body>
60
+ </html>
@@ -0,0 +1,19 @@
1
+ graph TD
2
+ validate_order[validate_order]
3
+ validate_order[validate_order] --> check_inventory[check_inventory]
4
+ validate_order[validate_order] --> calculate_shipping[calculate_shipping]
5
+ calculate_shipping[calculate_shipping] --> calculate_totals[calculate_totals]
6
+ check_inventory[check_inventory] --> calculate_totals[calculate_totals]
7
+ calculate_totals[calculate_totals] --> process_payment[process_payment]
8
+ process_payment[process_payment] --> reserve_inventory[reserve_inventory]
9
+ reserve_inventory[reserve_inventory] --> create_shipment[create_shipment]
10
+ create_shipment[create_shipment] --> send_email[send_email]
11
+ create_shipment[create_shipment] --> send_sms[send_sms]
12
+ send_email[send_email] --> finalize_order[finalize_order]
13
+ send_sms[send_sms] --> finalize_order[finalize_order]
14
+ classDef group1 fill:#9f9
15
+ class calculate_shipping group1
16
+ class check_inventory group1
17
+ classDef group6 fill:#9f9
18
+ class send_email group6
19
+ class send_sms group6
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simple_flow
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dewayne VanHoozer
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: SimpleFlow provides a clean and flexible architecture for orchestrating
13
+ multi-step workflows with middleware support, flow control, parallel execution,
14
+ and immutable results. Perfect for building data processing pipelines with cross-cutting
15
+ concerns like logging and instrumentation.
16
+ email:
17
+ - dvanhoozer@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".envrc"
23
+ - ".github/workflows/deploy-github-pages.yml"
24
+ - ".rubocop.yml"
25
+ - CHANGELOG.md
26
+ - COMMITS.md
27
+ - LICENSE
28
+ - README.md
29
+ - Rakefile
30
+ - benchmarks/parallel_vs_sequential.rb
31
+ - benchmarks/pipeline_overhead.rb
32
+ - docs/api/middleware.md
33
+ - docs/api/parallel-step.md
34
+ - docs/api/pipeline.md
35
+ - docs/api/result.md
36
+ - docs/concurrent/best-practices.md
37
+ - docs/concurrent/introduction.md
38
+ - docs/concurrent/parallel-steps.md
39
+ - docs/concurrent/performance.md
40
+ - docs/core-concepts/flow-control.md
41
+ - docs/core-concepts/middleware.md
42
+ - docs/core-concepts/overview.md
43
+ - docs/core-concepts/pipeline.md
44
+ - docs/core-concepts/result.md
45
+ - docs/core-concepts/steps.md
46
+ - docs/development/benchmarking.md
47
+ - docs/development/contributing.md
48
+ - docs/development/dagwood-concepts.md
49
+ - docs/development/testing.md
50
+ - docs/getting-started/examples.md
51
+ - docs/getting-started/installation.md
52
+ - docs/getting-started/quick-start.md
53
+ - docs/guides/choosing-concurrency-model.md
54
+ - docs/guides/complex-workflows.md
55
+ - docs/guides/data-fetching.md
56
+ - docs/guides/error-handling.md
57
+ - docs/guides/file-processing.md
58
+ - docs/guides/validation-patterns.md
59
+ - docs/index.md
60
+ - examples/.gitignore
61
+ - examples/01_basic_pipeline.rb
62
+ - examples/02_error_handling.rb
63
+ - examples/03_middleware.rb
64
+ - examples/04_parallel_automatic.rb
65
+ - examples/05_parallel_explicit.rb
66
+ - examples/06_real_world_ecommerce.rb
67
+ - examples/07_real_world_etl.rb
68
+ - examples/08_graph_visualization.rb
69
+ - examples/09_pipeline_visualization.rb
70
+ - examples/10_concurrency_control.rb
71
+ - examples/11_sequential_dependencies.rb
72
+ - examples/12_none_constant.rb
73
+ - examples/README.md
74
+ - examples/regression_test.rb
75
+ - examples/regression_test/01_basic_pipeline.txt
76
+ - examples/regression_test/02_error_handling.txt
77
+ - examples/regression_test/03_middleware.txt
78
+ - examples/regression_test/04_parallel_automatic.txt
79
+ - examples/regression_test/05_parallel_explicit.txt
80
+ - examples/regression_test/06_real_world_ecommerce.txt
81
+ - examples/regression_test/07_real_world_etl.txt
82
+ - examples/regression_test/08_graph_visualization.txt
83
+ - examples/regression_test/09_pipeline_visualization.txt
84
+ - examples/regression_test/10_concurrency_control.txt
85
+ - examples/regression_test/11_sequential_dependencies.txt
86
+ - examples/regression_test/12_none_constant.txt
87
+ - lib/simple_flow.rb
88
+ - lib/simple_flow/dependency_graph.rb
89
+ - lib/simple_flow/dependency_graph_visualizer.rb
90
+ - lib/simple_flow/middleware.rb
91
+ - lib/simple_flow/parallel_executor.rb
92
+ - lib/simple_flow/pipeline.rb
93
+ - lib/simple_flow/result.rb
94
+ - lib/simple_flow/step_tracker.rb
95
+ - lib/simple_flow/version.rb
96
+ - mkdocs.yml
97
+ - pipeline_graph.dot
98
+ - pipeline_graph.html
99
+ - pipeline_graph.mmd
100
+ homepage: https://github.com/MadBomber/simple_flow
101
+ licenses:
102
+ - MIT
103
+ metadata:
104
+ homepage_uri: https://github.com/MadBomber/simple_flow
105
+ source_code_uri: https://github.com/MadBomber/simple_flow
106
+ changelog_uri: https://github.com/MadBomber/simple_flow/blob/main/CHANGELOG.md
107
+ documentation_uri: https://github.com/MadBomber/simple_flow/blob/main/README.md
108
+ bug_tracker_uri: https://github.com/MadBomber/simple_flow/issues
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 3.2.0
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubygems_version: 3.7.2
124
+ specification_version: 4
125
+ summary: A lightweight, modular Ruby framework for building composable data processing
126
+ pipelines
127
+ test_files: []