passive_queue 0.1.0 → 1.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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.yard-lint.yml +94 -0
- data/CHANGELOG.md +16 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +9 -18
- data/README.md +466 -1
- data/Rakefile +4 -0
- data/html/{landing.html → index.html} +13 -11
- data/html/web-ui.png +0 -0
- data/lib/passive_queue/adapter.rb +28 -0
- data/lib/passive_queue/cli.rb +35 -0
- data/lib/passive_queue/configuration.rb +19 -1
- data/lib/passive_queue/engine.rb +8 -3
- data/lib/passive_queue/version.rb +1 -1
- data/lib/passive_queue/web.rb +39 -0
- data/lib/passive_queue.rb +22 -0
- data/passive_queue.gemspec +28 -0
- data/renovate.json +22 -0
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 14f8ed63b9c73cb9e5d8aaabb2ca9062bd28335c92b46cae2e676102fe23d2e9
|
|
4
|
+
data.tar.gz: 576d48dfdb6eef8d0725d5d1a48af30d971415386443c717e42feac607dd32f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c54ef9ca173d1e7ce2d5834669d07b3deed860d476f216066c1aaf0c49308ccbab6ee3d8fe593aa79e51adde5f1bf7541fe75cc1bfa51072570202542eb43b6c
|
|
7
|
+
data.tar.gz: 3be8fe8ce3cb36f1402456ac643139e9cb59dffe403b44c38b439b85d603f322bc267dc3d4377e20e4def4644947c2c2c63b57bf35211de36a1d3c0476656432
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.4.5
|
data/.yard-lint.yml
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# YARD-Lint Configuration
|
|
2
|
+
# Strict settings: all validators set to error severity and 100% coverage requirement
|
|
3
|
+
|
|
4
|
+
AllValidators:
|
|
5
|
+
# Fail on any error severity violation
|
|
6
|
+
FailOnSeverity: error
|
|
7
|
+
|
|
8
|
+
# Require 100% documentation coverage
|
|
9
|
+
MinCoverage: 100.0
|
|
10
|
+
|
|
11
|
+
# Include private and protected methods in validation
|
|
12
|
+
YardOptions:
|
|
13
|
+
- --private
|
|
14
|
+
- --protected
|
|
15
|
+
|
|
16
|
+
# Documentation Validators - All set to ERROR
|
|
17
|
+
Documentation/UndocumentedObjects:
|
|
18
|
+
Enabled: true
|
|
19
|
+
Severity: error
|
|
20
|
+
Description: All classes, modules, and methods must be documented
|
|
21
|
+
|
|
22
|
+
Documentation/UndocumentedMethodArguments:
|
|
23
|
+
Enabled: true
|
|
24
|
+
Severity: error
|
|
25
|
+
Description: All method parameters must have @param documentation
|
|
26
|
+
|
|
27
|
+
Documentation/UndocumentedReturnValue:
|
|
28
|
+
Enabled: true
|
|
29
|
+
Severity: error
|
|
30
|
+
Description: All methods with return values must have @return documentation
|
|
31
|
+
|
|
32
|
+
Documentation/MinimumDescriptionLength:
|
|
33
|
+
Enabled: true
|
|
34
|
+
Severity: error
|
|
35
|
+
MinLength: 10
|
|
36
|
+
Description: Documentation must be meaningful (minimum 10 characters)
|
|
37
|
+
|
|
38
|
+
Documentation/MarkdownSyntax:
|
|
39
|
+
Enabled: true
|
|
40
|
+
Severity: error
|
|
41
|
+
Description: All markdown in documentation must be valid
|
|
42
|
+
|
|
43
|
+
# Tag Validators - All set to ERROR
|
|
44
|
+
Tags/InvalidTypes:
|
|
45
|
+
Enabled: true
|
|
46
|
+
Severity: error
|
|
47
|
+
Description: Type specifications must use valid YARD syntax
|
|
48
|
+
|
|
49
|
+
Tags/Order:
|
|
50
|
+
Enabled: true
|
|
51
|
+
Severity: error
|
|
52
|
+
Description: Tags must follow consistent ordering
|
|
53
|
+
|
|
54
|
+
Tags/CollectionType:
|
|
55
|
+
Enabled: true
|
|
56
|
+
Severity: error
|
|
57
|
+
Description: Collections must use YARD standard syntax (e.g., Hash{K => V}, Array<Type>)
|
|
58
|
+
|
|
59
|
+
Tags/ExampleSyntax:
|
|
60
|
+
Enabled: true
|
|
61
|
+
Severity: error
|
|
62
|
+
Description: Code in @example tags must be valid Ruby syntax
|
|
63
|
+
|
|
64
|
+
Tags/MissingTypeInformation:
|
|
65
|
+
Enabled: true
|
|
66
|
+
Severity: error
|
|
67
|
+
Description: Tags requiring types must have type information
|
|
68
|
+
|
|
69
|
+
Tags/DuplicateTags:
|
|
70
|
+
Enabled: true
|
|
71
|
+
Severity: error
|
|
72
|
+
Description: No duplicate tags allowed (except @param, @option, @raise)
|
|
73
|
+
|
|
74
|
+
# Code Quality Validators - All set to ERROR
|
|
75
|
+
Quality/EmptyDescription:
|
|
76
|
+
Enabled: true
|
|
77
|
+
Severity: error
|
|
78
|
+
Description: Descriptions cannot be empty or whitespace-only
|
|
79
|
+
|
|
80
|
+
Quality/InconsistentIndentation:
|
|
81
|
+
Enabled: true
|
|
82
|
+
Severity: error
|
|
83
|
+
Description: Documentation must have consistent indentation
|
|
84
|
+
|
|
85
|
+
Quality/TrailingWhitespace:
|
|
86
|
+
Enabled: true
|
|
87
|
+
Severity: error
|
|
88
|
+
Description: No trailing whitespace in documentation
|
|
89
|
+
|
|
90
|
+
# Naming Validators - All set to ERROR
|
|
91
|
+
Naming/InconsistentParameterNames:
|
|
92
|
+
Enabled: true
|
|
93
|
+
Severity: error
|
|
94
|
+
Description: Parameter names in @param tags must match method signature
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. Since this is Passive Queue, "changes" might be a strong word.
|
|
4
4
|
|
|
5
|
+
## [1.1.0] - 2025-11-13
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Dropped Ruby 3.1 and 3.2 support - now requires Ruby >= 3.3.0
|
|
9
|
+
- Embracing modern Ruby while maintaining the art of doing nothing
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- GitHub Actions CI workflow with yard-lint validation
|
|
13
|
+
- Trusted publishing workflow for automated gem releases
|
|
14
|
+
- Continuous integration for documentation quality
|
|
15
|
+
|
|
16
|
+
## [1.0.1] - Unreleased
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Potential technical overhead by adding RSpec to the gem?
|
|
20
|
+
|
|
5
21
|
## [1.0.0] - 2025-07-12
|
|
6
22
|
|
|
7
23
|
### Added
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
passive_queue (1.
|
|
4
|
+
passive_queue (1.1.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rspec-core (3.13.5)
|
|
16
|
-
rspec-support (~> 3.13.0)
|
|
17
|
-
rspec-expectations (3.13.5)
|
|
18
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
19
|
-
rspec-support (~> 3.13.0)
|
|
20
|
-
rspec-mocks (3.13.5)
|
|
21
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
22
|
-
rspec-support (~> 3.13.0)
|
|
23
|
-
rspec-support (3.13.4)
|
|
9
|
+
rake (13.3.1)
|
|
10
|
+
yard (0.9.37)
|
|
11
|
+
yard-lint (1.2.2)
|
|
12
|
+
yard (~> 0.9)
|
|
13
|
+
zeitwerk (~> 2.6)
|
|
14
|
+
zeitwerk (2.7.3)
|
|
24
15
|
|
|
25
16
|
PLATFORMS
|
|
26
17
|
ruby
|
|
@@ -28,8 +19,8 @@ PLATFORMS
|
|
|
28
19
|
|
|
29
20
|
DEPENDENCIES
|
|
30
21
|
passive_queue!
|
|
31
|
-
rake
|
|
32
|
-
|
|
22
|
+
rake
|
|
23
|
+
yard-lint
|
|
33
24
|
|
|
34
25
|
BUNDLED WITH
|
|
35
26
|
2.6.9
|
data/README.md
CHANGED
|
@@ -1 +1,466 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/mensfeld/passive_queue/refs/heads/main/html/logo.svg" alt="passive queue logo" width="200">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Passive Queue
|
|
6
|
+
|
|
7
|
+
**"Why do today what you can put off indefinitely?"**
|
|
8
|
+
|
|
9
|
+
✨ 100% Free ✨ Zero Dependencies ✨ Infinite Scalability
|
|
10
|
+
|
|
11
|
+
Passive Queue is a revolutionary background job processing system that achieves 100% success rate by never actually processing any jobs. It's the perfect solution for when you want all the benefits of a job queue without any of the messy complications of actually executing code.
|
|
12
|
+
|
|
13
|
+
## Why Choose Passive Queue?
|
|
14
|
+
|
|
15
|
+
Embrace the zen of non-execution with features designed for the modern mindful developer:
|
|
16
|
+
|
|
17
|
+
- **100% Reliable Non-Execution** - Every job you schedule is guaranteed to not run. Zero false positives - your tasks will never accidentally complete.
|
|
18
|
+
|
|
19
|
+
- **Blazing Fast Non-Performance** - Completes in 0ms every time. Infinite scalability since nothing scales faster than nothing.
|
|
20
|
+
|
|
21
|
+
- **Drop-in Replacement** - Simply set Passive Queue as your queue adapter. All your existing jobs will gracefully do nothing.
|
|
22
|
+
|
|
23
|
+
- **Advanced Non-Monitoring** - Real-time dashboard showing exactly how much isn't happening with detailed logs of non-executed tasks.
|
|
24
|
+
|
|
25
|
+
- **Zen Mode Integration** - Built-in mindfulness features including `bundle exec be passive` for ultimate developer tranquility.
|
|
26
|
+
|
|
27
|
+
- **Zero Carbon Footprint** - The most environmentally friendly job processor. When you do nothing, you consume nothing.
|
|
28
|
+
|
|
29
|
+
## Simple. Elegant. Nothing.
|
|
30
|
+
|
|
31
|
+
Getting started is as easy as doing nothing:
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
# 1. Add it to your Gemfile
|
|
35
|
+
gem "passive_queue"
|
|
36
|
+
|
|
37
|
+
# 2. Set it as your queue adapter
|
|
38
|
+
class Application < Rails::Application
|
|
39
|
+
# ...
|
|
40
|
+
config.active_job.queue_adapter = :passive_queue
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# 3. Simply run it!
|
|
44
|
+
bundle exec be passive
|
|
45
|
+
|
|
46
|
+
# 4. Optionally you can also use the Web UI
|
|
47
|
+
Rails.application.routes.draw do
|
|
48
|
+
mount PassiveQueue::Engine => '/passive_queue'
|
|
49
|
+
end
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Live Dashboard
|
|
53
|
+
|
|
54
|
+
Experience Passive Queue in action with our beautiful dashboard:
|
|
55
|
+
|
|
56
|
+
- **Jobs Queued**: ∞ (All waiting peacefully)
|
|
57
|
+
- **Jobs Processed**: 0 (Perfect execution rate)
|
|
58
|
+
- **Uptime**: 100% (Of doing nothing)
|
|
59
|
+
- **Status**: Waiting for job to be scheduled...
|
|
60
|
+
|
|
61
|
+
Visit `/passive_queue` to witness the art of non-productivity in real-time with dark/light mode support!
|
|
62
|
+
|
|
63
|
+
<div align="center">
|
|
64
|
+
<img src="https://raw.githubusercontent.com/mensfeld/passive_queue/refs/heads/main/html/web-ui.png" alt="passive queue dashboard">
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
## Simple, Transparent Pricing
|
|
68
|
+
|
|
69
|
+
Pay nothing, get nothing. It's that simple.
|
|
70
|
+
|
|
71
|
+
### Free - $0 forever
|
|
72
|
+
- ✓ Up to ∞ jobs that won't run
|
|
73
|
+
- ✓ Basic non-monitoring
|
|
74
|
+
- ✓ Community non-support
|
|
75
|
+
- ✓ Zero carbon footprint
|
|
76
|
+
|
|
77
|
+
### Pro - $0 per month (Most Popular)
|
|
78
|
+
- ✓ Everything in Free
|
|
79
|
+
- ✓ Advanced non-analytics
|
|
80
|
+
- ✓ Priority non-execution
|
|
81
|
+
- ✓ Zen koans included
|
|
82
|
+
- ✓ 24/7 non-support
|
|
83
|
+
|
|
84
|
+
### Enterprise - $0 per month
|
|
85
|
+
- ✓ Everything in Pro
|
|
86
|
+
- ✓ Dedicated non-account manager
|
|
87
|
+
- ✓ Custom non-integrations
|
|
88
|
+
- ✓ SLA guaranteeing 99.99% non-uptime
|
|
89
|
+
- ✓ On-premise nothing deployment
|
|
90
|
+
|
|
91
|
+
## What Our Users Are Saying
|
|
92
|
+
|
|
93
|
+
Real feedback from developers who've achieved true non-productivity:
|
|
94
|
+
|
|
95
|
+
> "I scheduled 10,000 jobs last month and Passive Queue delivered on its promise - not a single one ran. Amazing!"
|
|
96
|
+
>
|
|
97
|
+
> **Sarah K.** - Senior Procrastination Engineer
|
|
98
|
+
|
|
99
|
+
> "Finally, a job processor that matches my work ethic. Passive Queue has revolutionized how I don't approach background tasks."
|
|
100
|
+
>
|
|
101
|
+
> **Mike T.** - Professional Postponer
|
|
102
|
+
|
|
103
|
+
> "Our productivity has never been lower. The peace of mind knowing nothing will ever execute accidentally is priceless."
|
|
104
|
+
>
|
|
105
|
+
> **DevOps Team** - Startup McStartupface
|
|
106
|
+
|
|
107
|
+
> "Since switching to Passive Queue, our newsletter emails never end up in spam folders. Our customers love the mystery of our non-communication strategy!"
|
|
108
|
+
>
|
|
109
|
+
> **Jessica R.** - Email Marketing Zen Master
|
|
110
|
+
|
|
111
|
+
> "Our data processing jobs can't corrupt the database if they never run. We've achieved 100% data integrity through the power of inaction!"
|
|
112
|
+
>
|
|
113
|
+
> **Alex L.** - Data Integrity Philosopher
|
|
114
|
+
|
|
115
|
+
> "Image resizing tasks that don't execute can't fill up our disk space. We've solved our storage problems by embracing the void. Genius!"
|
|
116
|
+
>
|
|
117
|
+
> **Carlos M.** - Storage Optimization Guru
|
|
118
|
+
|
|
119
|
+
## Performance Benchmarks
|
|
120
|
+
|
|
121
|
+
See how Passive Queue outperforms the competition in key metrics:
|
|
122
|
+
|
|
123
|
+
### Job Scheduling Speed
|
|
124
|
+
| Queue System | Jobs/Second | Latency (ms) | Memory Usage |
|
|
125
|
+
|--------------|-------------|--------------|--------------|
|
|
126
|
+
| **Passive Queue** | 10,000,000 | 0ms | 0 MB |
|
|
127
|
+
| Sidekiq | 4,137 | 2.3ms | 45 MB |
|
|
128
|
+
| Solid Queue | 1,932 | 3.1ms | 32 MB |
|
|
129
|
+
| Karafka | 22,850 | 1.8ms | 78 MB |
|
|
130
|
+
|
|
131
|
+
### Job Execution Performance
|
|
132
|
+
| Queue System | Avg Execution Time | Success Rate | Failed Jobs | Retry Overhead |
|
|
133
|
+
|--------------|-------------------|--------------|-------------|----------------|
|
|
134
|
+
| **Passive Queue** | 0ms | 100% | 0 | None |
|
|
135
|
+
| Sidekiq | 127ms | 97.3% | 2.7% | High |
|
|
136
|
+
| Solid Queue | 156ms | 96.8% | 3.2% | Medium |
|
|
137
|
+
| Karafka | 89ms | 98.1% | 1.9% | Low |
|
|
138
|
+
|
|
139
|
+
### Scalability Metrics
|
|
140
|
+
- **CPU Usage at 100k Jobs/hour**: Passive Queue 0% vs competitors 78-92%
|
|
141
|
+
- **Memory Usage Growth**: Passive Queue 0 MB vs competitors 780MB-1.8GB
|
|
142
|
+
- **Speed Advantage**: ∞x faster than any competitor
|
|
143
|
+
- **Cost Savings**: 100% - Zero infrastructure costs
|
|
144
|
+
- **Energy Efficiency**: Perfect - Zero carbon footprint
|
|
145
|
+
|
|
146
|
+
*Benchmark Disclaimer: All benchmark data has been carefully fabricated for entertainment purposes. Passive Queue's performance is theoretically perfect because it literally does nothing. Results may vary in production environments.*
|
|
147
|
+
|
|
148
|
+
## CLI Tools
|
|
149
|
+
|
|
150
|
+
### The Art of Being Passive
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Embrace the void
|
|
154
|
+
bundle exec be passive
|
|
155
|
+
|
|
156
|
+
# Meditate on your non-productivity
|
|
157
|
+
bundle exec be passive --zen
|
|
158
|
+
|
|
159
|
+
# Question the nature of execution
|
|
160
|
+
bundle exec be passive --philosophical
|
|
161
|
+
|
|
162
|
+
# Extended meditation sessions
|
|
163
|
+
bundle exec be passive --duration 30
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
💡 **Pro tip**: The most productive thing you can do is nothing. Passive Queue helps you achieve this zen state effortlessly.
|
|
167
|
+
|
|
168
|
+
## Configuration
|
|
169
|
+
|
|
170
|
+
```ruby
|
|
171
|
+
# config/initializers/passive_queue.rb
|
|
172
|
+
PassiveQueue.configure do |config|
|
|
173
|
+
config.meditation_duration = 10 # seconds
|
|
174
|
+
config.zen_level = :transcendent # :low, :medium, :high, :transcendent
|
|
175
|
+
config.philosophical_depth = :deep # :shallow, :deep, :profound, :existential
|
|
176
|
+
config.silence_mode = false # suppress all output
|
|
177
|
+
end
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Complete API Reference
|
|
181
|
+
|
|
182
|
+
### Core Adapter Class
|
|
183
|
+
|
|
184
|
+
The heart of Passive Queue's non-execution engine.
|
|
185
|
+
|
|
186
|
+
#### `PassiveQueue::Adapter`
|
|
187
|
+
|
|
188
|
+
```ruby
|
|
189
|
+
class PassiveQueue::Adapter
|
|
190
|
+
def initialize
|
|
191
|
+
# Initialize with the zen of doing nothing
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def enqueue(job)
|
|
195
|
+
# Gracefully accept a job for supreme non-execution
|
|
196
|
+
# Returns: Zen acceptance with logging
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def enqueue_at(job, timestamp)
|
|
200
|
+
# Schedule a job for perpetual non-execution at specified time
|
|
201
|
+
# Parameters:
|
|
202
|
+
# job: The job that will achieve eternal waiting
|
|
203
|
+
# timestamp: When the job should not be executed
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def enqueue_all(jobs)
|
|
207
|
+
# Accept multiple jobs with zen-like acceptance
|
|
208
|
+
# Parameters:
|
|
209
|
+
# jobs: Array of jobs to collectively not process
|
|
210
|
+
# Returns: Array of zen acceptances
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
def stopping?
|
|
214
|
+
# Always returns true - we're always in peaceful stopping state
|
|
215
|
+
# Returns: true (eternal zen state)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Configuration API
|
|
221
|
+
|
|
222
|
+
#### `PassiveQueue::Configuration`
|
|
223
|
+
|
|
224
|
+
```ruby
|
|
225
|
+
PassiveQueue.configure do |config|
|
|
226
|
+
config.meditation_duration = 5 # Duration in seconds (default: 5)
|
|
227
|
+
config.zen_level = :medium # :low, :medium, :high, :transcendent
|
|
228
|
+
config.philosophical_depth = :shallow # :shallow, :deep, :profound, :existential
|
|
229
|
+
config.silence_mode = false # Suppress all enlightening output
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Access configuration
|
|
233
|
+
PassiveQueue.configuration.zen_levels # => [:low, :medium, :high, :transcendent]
|
|
234
|
+
PassiveQueue.configuration.philosophical_depths # => [:shallow, :deep, :profound, :existential]
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Wisdom API
|
|
238
|
+
|
|
239
|
+
#### `PassiveQueue.zen_quotes`
|
|
240
|
+
|
|
241
|
+
Returns an array of enlightening quotes about the art of non-execution:
|
|
242
|
+
|
|
243
|
+
```ruby
|
|
244
|
+
PassiveQueue.zen_quotes
|
|
245
|
+
# => [
|
|
246
|
+
# "The best job is the one never executed.",
|
|
247
|
+
# "In the stillness of non-processing, we find true performance.",
|
|
248
|
+
# "Why do something when you can do nothing?",
|
|
249
|
+
# "The art of non-execution is the highest form of productivity.",
|
|
250
|
+
# "A queue that does nothing is a queue that never fails.",
|
|
251
|
+
# "In the void of processing, infinite possibilities exist.",
|
|
252
|
+
# "The job that is never run is the job that never crashes.",
|
|
253
|
+
# "Embrace the emptiness of your background tasks.",
|
|
254
|
+
# "True scalability comes from processing nothing at all.",
|
|
255
|
+
# "The zen master processes without processing."
|
|
256
|
+
# ]
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### `PassiveQueue.philosophical_thoughts`
|
|
260
|
+
|
|
261
|
+
Returns an array of deep philosophical insights:
|
|
262
|
+
|
|
263
|
+
```ruby
|
|
264
|
+
PassiveQueue.philosophical_thoughts
|
|
265
|
+
# => [
|
|
266
|
+
# "If a job is scheduled but never runs, did it ever really exist?",
|
|
267
|
+
# "What is the sound of one background task not processing?",
|
|
268
|
+
# "The universe is vast and infinite, much like your job queue.",
|
|
269
|
+
# "In the grand scheme of things, what difference does one unprocessed job make?",
|
|
270
|
+
# "Perhaps the real treasure was the jobs we never processed along the way.",
|
|
271
|
+
# "Time is an illusion. Deadlines are an even bigger illusion.",
|
|
272
|
+
# "The job queue is a metaphor for the human condition.",
|
|
273
|
+
# "We are all just jobs waiting to be processed in the great queue of existence.",
|
|
274
|
+
# "The passive queue teaches us that sometimes the most profound action is inaction.",
|
|
275
|
+
# "In choosing to do nothing, we choose everything."
|
|
276
|
+
# ]
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Web Dashboard API
|
|
280
|
+
|
|
281
|
+
Mount the dashboard to access these enlightening endpoints:
|
|
282
|
+
|
|
283
|
+
```ruby
|
|
284
|
+
# config/routes.rb
|
|
285
|
+
Rails.application.routes.draw do
|
|
286
|
+
mount PassiveQueue::Engine => '/passive_queue'
|
|
287
|
+
end
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### `GET /passive_queue/api/stats`
|
|
291
|
+
|
|
292
|
+
Returns comprehensive non-performance metrics:
|
|
293
|
+
|
|
294
|
+
```json
|
|
295
|
+
{
|
|
296
|
+
"jobs_queued": 42579,
|
|
297
|
+
"jobs_processed": 0,
|
|
298
|
+
"jobs_failed": 0,
|
|
299
|
+
"jobs_succeeded": "∞",
|
|
300
|
+
"uptime": "127 days of perfect inactivity",
|
|
301
|
+
"memory_usage": "0 MB",
|
|
302
|
+
"cpu_usage": "0%",
|
|
303
|
+
"queue_names": ["default", "mailers", "active_storage", "imports", "exports"],
|
|
304
|
+
"processing_time": "0ms",
|
|
305
|
+
"success_rate": "100%",
|
|
306
|
+
"zen_level": "Transcendent"
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### `GET /passive_queue/api/zen`
|
|
311
|
+
|
|
312
|
+
Returns a randomly selected zen quote for daily enlightenment:
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"quote": "The best job is the one never executed."
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
#### `GET /passive_queue/`
|
|
321
|
+
|
|
322
|
+
The main dashboard featuring:
|
|
323
|
+
- Real-time stats of jobs not being processed
|
|
324
|
+
- System metrics showing perfect efficiency (0% CPU, 0 MB memory)
|
|
325
|
+
- Queue status with detailed non-activity logs
|
|
326
|
+
- Zen quotes for daily inspiration
|
|
327
|
+
- Dark/light mode support for comfortable non-monitoring
|
|
328
|
+
- Recent non-activity table showing successfully not processed jobs
|
|
329
|
+
|
|
330
|
+
### CLI API
|
|
331
|
+
|
|
332
|
+
#### `PassiveQueue::CLI`
|
|
333
|
+
|
|
334
|
+
Access the command-line interface for ultimate zen:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
# Basic meditation mode
|
|
338
|
+
be passive
|
|
339
|
+
|
|
340
|
+
# Options available:
|
|
341
|
+
be passive --zen # Enable zen quotes during meditation
|
|
342
|
+
be passive --philosophical # Enable philosophical thoughts
|
|
343
|
+
be passive --duration 10 # Set meditation duration (seconds)
|
|
344
|
+
be passive --aggressive # ERROR: Conflicts with zen philosophy
|
|
345
|
+
be passive --help # Show enlightening help message
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Example CLI session:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
$ be passive --zen --duration 10
|
|
352
|
+
🧘 Entering passive meditation mode...
|
|
353
|
+
Duration: 10 seconds
|
|
354
|
+
Zen level: transcendent
|
|
355
|
+
|
|
356
|
+
💭 The best job is the one never executed.
|
|
357
|
+
|
|
358
|
+
💭 In the stillness of non-processing, we find true performance.
|
|
359
|
+
|
|
360
|
+
💭 A queue that does nothing is a queue that never fails.
|
|
361
|
+
|
|
362
|
+
✨ Meditation complete! You successfully did nothing for 10.02 seconds.
|
|
363
|
+
Your passive queue energy has been restored.
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### ActiveJob Integration API
|
|
367
|
+
|
|
368
|
+
#### Seamless Rails Integration
|
|
369
|
+
|
|
370
|
+
```ruby
|
|
371
|
+
# Automatic adapter registration
|
|
372
|
+
# No additional configuration needed beyond:
|
|
373
|
+
config.active_job.queue_adapter = :passive_queue
|
|
374
|
+
|
|
375
|
+
# Your existing jobs work unchanged:
|
|
376
|
+
class UserMailerJob < ApplicationJob
|
|
377
|
+
queue_as :default
|
|
378
|
+
|
|
379
|
+
def perform(user_id)
|
|
380
|
+
# This code achieves zen through non-execution
|
|
381
|
+
UserMailer.welcome_email(User.find(user_id)).deliver_now
|
|
382
|
+
end
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# Queue as normal - job will be gracefully not processed
|
|
386
|
+
UserMailerJob.perform_later(user.id)
|
|
387
|
+
# Output: 🧘 Passively accepted UserMailerJob with supreme non-execution
|
|
388
|
+
# Arguments: [123]
|
|
389
|
+
# Queue: default
|
|
390
|
+
# Status: Successfully not processed ✨
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Error Handling API
|
|
394
|
+
|
|
395
|
+
Passive Queue's revolutionary approach to error handling:
|
|
396
|
+
|
|
397
|
+
```ruby
|
|
398
|
+
# No errors can occur because no code executes
|
|
399
|
+
# Perfect exception handling through non-execution
|
|
400
|
+
# 100% uptime guaranteed through inactivity
|
|
401
|
+
# Zero error logs because zero errors are possible
|
|
402
|
+
|
|
403
|
+
# Exception hierarchy (for philosophical completeness):
|
|
404
|
+
PassiveQueue::Error < StandardError
|
|
405
|
+
# ^ Never raised because nothing ever fails
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Monitoring & Observability API
|
|
409
|
+
|
|
410
|
+
```ruby
|
|
411
|
+
# All metrics are perfectly predictable:
|
|
412
|
+
# - Jobs processed: Always 0
|
|
413
|
+
# - Memory usage: Always 0 MB
|
|
414
|
+
# - CPU usage: Always 0%
|
|
415
|
+
# - Error rate: Always 0%
|
|
416
|
+
# - Success rate: Always 100%
|
|
417
|
+
# - Latency: Always 0ms
|
|
418
|
+
# - Throughput: ∞ jobs/second (in the realm of non-execution)
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## Philosophy
|
|
422
|
+
|
|
423
|
+
Passive Queue is built on the fundamental principle that the most reliable code is code that never runs. By embracing the art of non-execution, we achieve:
|
|
424
|
+
|
|
425
|
+
- **Perfect Reliability**: Never fails because never executes
|
|
426
|
+
- **Infinite Performance**: Completes instantly by doing nothing
|
|
427
|
+
- **Zero Resource Usage**: The ultimate in efficiency
|
|
428
|
+
- **Complete Compatibility**: Works with any existing job without modification
|
|
429
|
+
- **Inner Peace**: Developers can rest easy knowing nothing will break
|
|
430
|
+
|
|
431
|
+
## FAQ
|
|
432
|
+
|
|
433
|
+
**Q: Will my jobs actually run?**
|
|
434
|
+
A: No, and that's the point! Your jobs achieve perfect success by never executing.
|
|
435
|
+
|
|
436
|
+
**Q: What happens to the job data?**
|
|
437
|
+
A: It's gracefully accepted and logged, then achieves eternal zen in the void of non-processing.
|
|
438
|
+
|
|
439
|
+
**Q: Is this production ready?**
|
|
440
|
+
A: Absolutely! Version 1.0.0 represents the pinnacle of stability through inaction.
|
|
441
|
+
|
|
442
|
+
**Q: How do I debug failed jobs?**
|
|
443
|
+
A: There are no failed jobs, only successfully non-executed ones.
|
|
444
|
+
|
|
445
|
+
**Q: What about job retries?**
|
|
446
|
+
A: Why retry when you can achieve perfect success the first time by doing nothing?
|
|
447
|
+
|
|
448
|
+
## Contributing
|
|
449
|
+
|
|
450
|
+
We welcome contributions that further the art of non-productivity. Fork the repository, create a feature branch, commit your non-changes, push to the branch, and create a Pull Request for review.
|
|
451
|
+
|
|
452
|
+
## License
|
|
453
|
+
|
|
454
|
+
This project is licensed under the MIT License.
|
|
455
|
+
|
|
456
|
+
## Acknowledgments
|
|
457
|
+
|
|
458
|
+
Inspired by the zen philosophy of doing nothing and several attendees of the RailsConf 2025. Built with love, Ruby, and an appreciation for the absurd. Special thanks to all the background jobs that never ran.
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
*"In choosing to do nothing, we choose everything."* - Passive Queue Philosophy
|
|
463
|
+
|
|
464
|
+
**The Art of Non-Execution**
|
|
465
|
+
|
|
466
|
+
© 2025 Maciej Mensfeld. All rights reserved. No jobs were harmed in the making of this product.
|
data/Rakefile
ADDED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Passive Queue - The Art of Non-Execution</title>
|
|
7
7
|
|
|
8
|
+
<link rel="icon" href="logo.svg" type="image/svg+xml">
|
|
8
9
|
<script>
|
|
9
10
|
(function() {
|
|
10
11
|
// Get saved theme or default to auto
|
|
@@ -210,17 +211,17 @@
|
|
|
210
211
|
<li><a href="#demo">Demo</a></li>
|
|
211
212
|
</ul>
|
|
212
213
|
</div>
|
|
213
|
-
<a class="btn btn-ghost text-xl font-light" href="https://passivequeue.pro">
|
|
214
214
|
|
|
215
215
|
|
|
216
|
+
<a class="btn btn-ghost text-xl font-light" href="https://passivequeue.pro">
|
|
216
217
|
<img src="logo.svg" alt="Passive Queue Logo"
|
|
217
|
-
class="w-16 h-16 mx-auto mb-0 block mr-2 logo-light" id="" style="width: 28px; height: 28px;">
|
|
218
|
+
class="w-16 h-16 mx-auto mb-0 block mr-2 logo-light hidden" id="" style="width: 28px; height: 28px;">
|
|
218
219
|
<!-- Dark mode logo -->
|
|
219
220
|
<img src="logo-dark.svg" alt="Passive Queue Logo"
|
|
220
221
|
class="w-16 h-16 mx-auto mb-0 mr-2 hidden logo-dark" id="" style="width: 28px; height: 28px;">
|
|
222
|
+
<span class="hidden md:inline">Passive Queue</span>
|
|
223
|
+
</a>
|
|
221
224
|
|
|
222
|
-
Passive Queue
|
|
223
|
-
</a>
|
|
224
225
|
</div>
|
|
225
226
|
<div class="navbar-center hidden lg:flex">
|
|
226
227
|
<ul class="menu menu-horizontal px-1 text-lg">
|
|
@@ -307,9 +308,9 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', upd
|
|
|
307
308
|
<a href="#install" class="btn btn-primary btn-lg">
|
|
308
309
|
Get Started Right Now!
|
|
309
310
|
</a>
|
|
310
|
-
<
|
|
311
|
+
<a href="https://github.com/mensfeld/passive_queue/?tab=readme-ov-file#complete-api-reference" class="btn btn-outline btn-lg">
|
|
311
312
|
View Documentation
|
|
312
|
-
</
|
|
313
|
+
</a>
|
|
313
314
|
</div>
|
|
314
315
|
<div class="mt-8 text-sm text-base-content/80">
|
|
315
316
|
✨ 100% Free ✨ Zero Dependencies ✨ Infinite Scalability
|
|
@@ -1026,8 +1027,8 @@ bundle exec be passive --philosophical</code></pre>
|
|
|
1026
1027
|
</div>
|
|
1027
1028
|
|
|
1028
1029
|
<div class="card-actions justify-center mt-8">
|
|
1029
|
-
<
|
|
1030
|
-
<
|
|
1030
|
+
<a href="https://github.com/mensfeld/passive_queue/?tab=readme-ov-file#complete-api-reference" class="btn btn-primary">View Full Documentation</a>
|
|
1031
|
+
<a href="https://github.com/mensfeld/passive_queue/?tab=readme-ov-file#complete-api-reference" class="btn btn-outline">API Reference</a>
|
|
1031
1032
|
</div>
|
|
1032
1033
|
</div>
|
|
1033
1034
|
</div>
|
|
@@ -1035,7 +1036,8 @@ bundle exec be passive --philosophical</code></pre>
|
|
|
1035
1036
|
</div>
|
|
1036
1037
|
</section>
|
|
1037
1038
|
<!-- Footer -->
|
|
1038
|
-
|
|
1039
|
+
|
|
1040
|
+
<footer class="footer footer-center p-10 bg-base-200 text-base-content hidden md:block">
|
|
1039
1041
|
<aside>
|
|
1040
1042
|
<div class="text-4xl mb-4">
|
|
1041
1043
|
<img src="logo.svg" alt="Passive Queue Logo"
|
|
@@ -1049,7 +1051,7 @@ bundle exec be passive --philosophical</code></pre>
|
|
|
1049
1051
|
<p class="font-light">The Art of Non-Execution</p>
|
|
1050
1052
|
<p class="text-sm text-base-content/60">© 2025 Maciej Mensfeld. All rights reserved. No jobs were harmed in the making of this product.</p>
|
|
1051
1053
|
</aside>
|
|
1052
|
-
<nav>
|
|
1054
|
+
<nav class="mt-6">
|
|
1053
1055
|
<div class="grid grid-flow-col gap-4">
|
|
1054
1056
|
<a href="https://github.com/mensfeld/passive_queue" class="link link-hover">GitHub</a>
|
|
1055
1057
|
<a href="#docs" class="link link-hover">Documentation</a>
|
|
@@ -1057,7 +1059,7 @@ bundle exec be passive --philosophical</code></pre>
|
|
|
1057
1059
|
<a href="https://mensfeld.pl/tag/passive_queue/" class="link link-hover">Blog</a>
|
|
1058
1060
|
</div>
|
|
1059
1061
|
</nav>
|
|
1060
|
-
<nav>
|
|
1062
|
+
<nav class="mt-6">
|
|
1061
1063
|
<div class="grid grid-flow-col gap-4">
|
|
1062
1064
|
<a href="https://twitter.com/maciejmensfeld" class="btn btn-ghost btn-sm">
|
|
1063
1065
|
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24">
|
data/html/web-ui.png
ADDED
|
Binary file
|
|
@@ -1,27 +1,50 @@
|
|
|
1
1
|
module PassiveQueue
|
|
2
|
+
# ActiveJob queue adapter that accepts jobs but never processes them.
|
|
3
|
+
# Implements the ActiveJob adapter interface with zen-like non-execution.
|
|
2
4
|
class Adapter
|
|
5
|
+
# Initializes a new Adapter instance with the zen of doing nothing
|
|
3
6
|
def initialize
|
|
4
7
|
# Initialize with the zen of doing nothing
|
|
5
8
|
end
|
|
6
9
|
|
|
10
|
+
# Enqueues a job for immediate non-execution
|
|
11
|
+
#
|
|
12
|
+
# @param job [ActiveJob::Base] the job to passively accept
|
|
13
|
+
# @return [void]
|
|
7
14
|
def enqueue(job)
|
|
8
15
|
log_job_acceptance(job)
|
|
9
16
|
end
|
|
10
17
|
|
|
18
|
+
# Enqueues a job for delayed non-execution at a specific time
|
|
19
|
+
#
|
|
20
|
+
# @param job [ActiveJob::Base] the job to schedule for non-execution
|
|
21
|
+
# @param timestamp [Numeric] Unix timestamp when the job should not be executed
|
|
22
|
+
# @return [void]
|
|
11
23
|
def enqueue_at(job, timestamp)
|
|
12
24
|
log_job_scheduling(job, timestamp)
|
|
13
25
|
end
|
|
14
26
|
|
|
27
|
+
# Enqueues multiple jobs for batch non-execution
|
|
28
|
+
#
|
|
29
|
+
# @param jobs [Array<ActiveJob::Base>] array of jobs to passively accept
|
|
30
|
+
# @return [Array<void>] results of enqueueing each job
|
|
15
31
|
def enqueue_all(jobs)
|
|
16
32
|
jobs.map { |job| enqueue(job) }
|
|
17
33
|
end
|
|
18
34
|
|
|
35
|
+
# Returns whether the adapter is stopping (always true for zen purposes)
|
|
36
|
+
#
|
|
37
|
+
# @return [Boolean] always returns true to maintain peaceful state
|
|
19
38
|
def stopping?
|
|
20
39
|
true
|
|
21
40
|
end
|
|
22
41
|
|
|
23
42
|
private
|
|
24
43
|
|
|
44
|
+
# Logs acceptance of a job with zen messaging
|
|
45
|
+
#
|
|
46
|
+
# @param job [ActiveJob::Base] the job being accepted
|
|
47
|
+
# @return [void]
|
|
25
48
|
def log_job_acceptance(job)
|
|
26
49
|
return if PassiveQueue.configuration.silence_mode
|
|
27
50
|
|
|
@@ -31,6 +54,11 @@ module PassiveQueue
|
|
|
31
54
|
puts " Status: Successfully not processed ✨"
|
|
32
55
|
end
|
|
33
56
|
|
|
57
|
+
# Logs scheduling of a job with philosophical messaging
|
|
58
|
+
#
|
|
59
|
+
# @param job [ActiveJob::Base] the job being scheduled
|
|
60
|
+
# @param timestamp [Numeric] Unix timestamp for scheduled non-execution
|
|
61
|
+
# @return [void]
|
|
34
62
|
def log_job_scheduling(job, timestamp)
|
|
35
63
|
return if PassiveQueue.configuration.silence_mode
|
|
36
64
|
|
data/lib/passive_queue/cli.rb
CHANGED
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
# lib/passive_queue/cli.rb
|
|
3
3
|
# ================================
|
|
4
4
|
module PassiveQueue
|
|
5
|
+
# Command-line interface for PassiveQueue meditation and zen commands
|
|
5
6
|
class CLI
|
|
7
|
+
# Entry point for the CLI application
|
|
8
|
+
#
|
|
9
|
+
# @param args [Array<String>] command-line arguments
|
|
10
|
+
# @return [void]
|
|
6
11
|
def self.start(args)
|
|
7
12
|
new.run(args)
|
|
8
13
|
end
|
|
9
14
|
|
|
15
|
+
# Runs the CLI with provided arguments
|
|
16
|
+
#
|
|
17
|
+
# @param args [Array<String>] command-line arguments to process
|
|
18
|
+
# @return [void]
|
|
10
19
|
def run(args)
|
|
11
20
|
# Parse arguments manually (no Thor dependency)
|
|
12
21
|
options = parse_args(args)
|
|
@@ -25,6 +34,10 @@ module PassiveQueue
|
|
|
25
34
|
|
|
26
35
|
private
|
|
27
36
|
|
|
37
|
+
# Parses command-line arguments into an options hash
|
|
38
|
+
#
|
|
39
|
+
# @param args [Array<String>] raw command-line arguments
|
|
40
|
+
# @return [Hash] parsed options with zen, philosophical, aggressive, and duration keys
|
|
28
41
|
def parse_args(args)
|
|
29
42
|
options = {
|
|
30
43
|
zen: false,
|
|
@@ -49,6 +62,14 @@ module PassiveQueue
|
|
|
49
62
|
options
|
|
50
63
|
end
|
|
51
64
|
|
|
65
|
+
# Executes the passive meditation command
|
|
66
|
+
#
|
|
67
|
+
# @param options [Hash] parsed command-line options
|
|
68
|
+
# @option options [Boolean] :zen enable zen quotes during meditation
|
|
69
|
+
# @option options [Boolean] :philosophical enable philosophical thoughts
|
|
70
|
+
# @option options [Boolean] :aggressive aggressively passive mode (not recommended)
|
|
71
|
+
# @option options [Numeric] :duration meditation duration in seconds
|
|
72
|
+
# @return [void]
|
|
52
73
|
def passive_command(options)
|
|
53
74
|
if options[:aggressive]
|
|
54
75
|
puts "❌ Error: Don't be aggressive! The path of the passive queue is one of peace."
|
|
@@ -79,6 +100,13 @@ module PassiveQueue
|
|
|
79
100
|
puts " Your passive queue energy has been restored."
|
|
80
101
|
end
|
|
81
102
|
|
|
103
|
+
# Meditates with zen quotes or philosophical thoughts
|
|
104
|
+
#
|
|
105
|
+
# @param duration [Numeric] meditation duration in seconds
|
|
106
|
+
# @param options [Hash] options hash containing zen or philosophical flags
|
|
107
|
+
# @option options [Boolean] :zen enable zen quotes during meditation
|
|
108
|
+
# @option options [Boolean] :philosophical enable philosophical thoughts
|
|
109
|
+
# @return [void]
|
|
82
110
|
def meditate_with_wisdom(duration, options)
|
|
83
111
|
interval = duration / 3.0
|
|
84
112
|
|
|
@@ -94,6 +122,10 @@ module PassiveQueue
|
|
|
94
122
|
end
|
|
95
123
|
end
|
|
96
124
|
|
|
125
|
+
# Meditates silently with animated dots
|
|
126
|
+
#
|
|
127
|
+
# @param duration [Numeric] meditation duration in seconds
|
|
128
|
+
# @return [void]
|
|
97
129
|
def meditate_silently(duration)
|
|
98
130
|
print " Meditating"
|
|
99
131
|
|
|
@@ -112,6 +144,9 @@ module PassiveQueue
|
|
|
112
144
|
end
|
|
113
145
|
end
|
|
114
146
|
|
|
147
|
+
# Displays help information for the CLI
|
|
148
|
+
#
|
|
149
|
+
# @return [void]
|
|
115
150
|
def show_help
|
|
116
151
|
puts <<~HELP
|
|
117
152
|
Passive Queue CLI - The zen of non-productivity
|
|
@@ -2,9 +2,21 @@
|
|
|
2
2
|
# lib/passive_queue/configuration.rb
|
|
3
3
|
# ================================
|
|
4
4
|
module PassiveQueue
|
|
5
|
+
# Configuration settings for PassiveQueue behavior and aesthetics
|
|
5
6
|
class Configuration
|
|
6
|
-
|
|
7
|
+
# @return [Integer] meditation duration in seconds
|
|
8
|
+
attr_accessor :meditation_duration
|
|
7
9
|
|
|
10
|
+
# @return [Symbol] current zen level (:low, :medium, :high, :transcendent)
|
|
11
|
+
attr_accessor :zen_level
|
|
12
|
+
|
|
13
|
+
# @return [Symbol] philosophical depth (:shallow, :deep, :profound, :existential)
|
|
14
|
+
attr_accessor :philosophical_depth
|
|
15
|
+
|
|
16
|
+
# @return [Boolean] whether to suppress output logging
|
|
17
|
+
attr_accessor :silence_mode
|
|
18
|
+
|
|
19
|
+
# Initializes configuration with default zen values
|
|
8
20
|
def initialize
|
|
9
21
|
@meditation_duration = 5 # seconds
|
|
10
22
|
@zen_level = :medium
|
|
@@ -12,10 +24,16 @@ module PassiveQueue
|
|
|
12
24
|
@silence_mode = false
|
|
13
25
|
end
|
|
14
26
|
|
|
27
|
+
# Returns available zen levels
|
|
28
|
+
#
|
|
29
|
+
# @return [Array<Symbol>] valid zen level options
|
|
15
30
|
def zen_levels
|
|
16
31
|
%i[low medium high transcendent]
|
|
17
32
|
end
|
|
18
33
|
|
|
34
|
+
# Returns available philosophical depth levels
|
|
35
|
+
#
|
|
36
|
+
# @return [Array<Symbol>] valid philosophical depth options
|
|
19
37
|
def philosophical_depths
|
|
20
38
|
%i[shallow deep profound existential]
|
|
21
39
|
end
|
data/lib/passive_queue/engine.rb
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
# ================================
|
|
2
|
-
# lib/passive_queue/engine.rb
|
|
2
|
+
# lib/passive_queue/engine.rb
|
|
3
3
|
# ================================
|
|
4
4
|
module PassiveQueue
|
|
5
|
+
# Rack engine that mounts the PassiveQueue web dashboard in Rails applications
|
|
5
6
|
class Engine
|
|
7
|
+
# Rack call method that delegates to the Web application
|
|
8
|
+
#
|
|
9
|
+
# @param env [Hash] Rack environment hash
|
|
10
|
+
# @return [Array] Rack response triplet [status, headers, body]
|
|
6
11
|
def self.call(env)
|
|
7
12
|
# Strip the mount path to get relative path
|
|
8
13
|
path_info = env['PATH_INFO']
|
|
9
14
|
script_name = env['SCRIPT_NAME']
|
|
10
|
-
|
|
15
|
+
|
|
11
16
|
# Create new env with adjusted paths for the Web app
|
|
12
17
|
web_env = env.dup
|
|
13
18
|
web_env['PATH_INFO'] = path_info
|
|
14
19
|
web_env['SCRIPT_NAME'] = script_name
|
|
15
|
-
|
|
20
|
+
|
|
16
21
|
Web.new.call(web_env)
|
|
17
22
|
end
|
|
18
23
|
end
|
data/lib/passive_queue/web.rb
CHANGED
|
@@ -5,7 +5,12 @@ require 'erb'
|
|
|
5
5
|
require 'json'
|
|
6
6
|
|
|
7
7
|
module PassiveQueue
|
|
8
|
+
# Rack web application providing a dashboard interface for PassiveQueue
|
|
8
9
|
class Web
|
|
10
|
+
# Rack call method that routes requests to appropriate handlers
|
|
11
|
+
#
|
|
12
|
+
# @param env [Hash] Rack environment hash
|
|
13
|
+
# @return [Array] Rack response triplet [status, headers, body]
|
|
9
14
|
def call(env)
|
|
10
15
|
request = Rack::Request.new(env)
|
|
11
16
|
|
|
@@ -29,11 +34,17 @@ module PassiveQueue
|
|
|
29
34
|
|
|
30
35
|
private
|
|
31
36
|
|
|
37
|
+
# Renders the main dashboard HTML page
|
|
38
|
+
#
|
|
39
|
+
# @return [Array] Rack response with HTML dashboard
|
|
32
40
|
def dashboard_response
|
|
33
41
|
html = dashboard_html
|
|
34
42
|
[200, {'Content-Type' => 'text/html'}, [html]]
|
|
35
43
|
end
|
|
36
44
|
|
|
45
|
+
# Returns JSON response with queue statistics
|
|
46
|
+
#
|
|
47
|
+
# @return [Array] Rack response with JSON stats data
|
|
37
48
|
def api_stats_response
|
|
38
49
|
stats = {
|
|
39
50
|
jobs_queued: rand(9999..99999),
|
|
@@ -51,45 +62,72 @@ module PassiveQueue
|
|
|
51
62
|
[200, {'Content-Type' => 'application/json'}, [stats.to_json]]
|
|
52
63
|
end
|
|
53
64
|
|
|
65
|
+
# Returns JSON response with a random zen quote
|
|
66
|
+
#
|
|
67
|
+
# @return [Array] Rack response with JSON zen quote
|
|
54
68
|
def api_zen_response
|
|
55
69
|
quote = PassiveQueue.zen_quotes.sample
|
|
56
70
|
[200, {'Content-Type' => 'application/json'}, [{quote: quote}.to_json]]
|
|
57
71
|
end
|
|
58
72
|
|
|
73
|
+
# Returns CSS stylesheet response (unused method)
|
|
74
|
+
#
|
|
75
|
+
# @return [Array] Rack response with CSS content
|
|
59
76
|
def css_response
|
|
60
77
|
css = dashboard_css
|
|
61
78
|
[200, {'Content-Type' => 'text/css'}, [css]]
|
|
62
79
|
end
|
|
63
80
|
|
|
81
|
+
# Returns the light theme logo SVG
|
|
82
|
+
#
|
|
83
|
+
# @return [Array] Rack response with SVG logo
|
|
64
84
|
def logo_response
|
|
65
85
|
svg = logo_svg
|
|
66
86
|
[200, {'Content-Type' => 'image/svg+xml'}, [svg]]
|
|
67
87
|
end
|
|
68
88
|
|
|
89
|
+
# Returns the dark theme logo SVG
|
|
90
|
+
#
|
|
91
|
+
# @return [Array] Rack response with dark theme SVG logo
|
|
69
92
|
def logo_dark_response
|
|
70
93
|
svg = logo_svg_dark
|
|
71
94
|
[200, {'Content-Type' => 'image/svg+xml'}, [svg]]
|
|
72
95
|
end
|
|
73
96
|
|
|
97
|
+
# Returns an empty favicon response
|
|
98
|
+
#
|
|
99
|
+
# @return [Array] Rack response with empty favicon
|
|
74
100
|
def favicon_response
|
|
75
101
|
# Return empty response for favicon
|
|
76
102
|
[200, {'Content-Type' => 'image/x-icon'}, ['']]
|
|
77
103
|
end
|
|
78
104
|
|
|
105
|
+
# Returns a 404 not found response with zen humor
|
|
106
|
+
#
|
|
107
|
+
# @return [Array] Rack response with 404 HTML
|
|
79
108
|
def not_found_response
|
|
80
109
|
[404, {'Content-Type' => 'text/html'}, ['<h1>404 - Page Not Found (Just Like Our Jobs)</h1>']]
|
|
81
110
|
end
|
|
82
111
|
|
|
112
|
+
# Reads and returns the light theme logo SVG content
|
|
113
|
+
#
|
|
114
|
+
# @return [String] SVG file contents
|
|
83
115
|
def logo_svg
|
|
84
116
|
logo_path = File.join(File.dirname(__FILE__), '..', '..', 'html', 'logo.svg')
|
|
85
117
|
File.read(logo_path)
|
|
86
118
|
end
|
|
87
119
|
|
|
120
|
+
# Reads and returns the dark theme logo SVG content
|
|
121
|
+
#
|
|
122
|
+
# @return [String] dark theme SVG file contents
|
|
88
123
|
def logo_svg_dark
|
|
89
124
|
logo_path = File.join(File.dirname(__FILE__), '..', '..', 'html', 'logo-dark.svg')
|
|
90
125
|
File.read(logo_path)
|
|
91
126
|
end
|
|
92
127
|
|
|
128
|
+
# Generates and returns the complete dashboard HTML
|
|
129
|
+
#
|
|
130
|
+
# @return [String] HTML content for the dashboard page
|
|
93
131
|
def dashboard_html
|
|
94
132
|
<<~HTML
|
|
95
133
|
<!DOCTYPE html>
|
|
@@ -98,6 +136,7 @@ module PassiveQueue
|
|
|
98
136
|
<meta charset="UTF-8">
|
|
99
137
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
100
138
|
<title>Passive Queue Dashboard - The Art of Non-Execution</title>
|
|
139
|
+
<link rel="icon" href="/passive_queue/logo.svg" type="image/svg+xml">
|
|
101
140
|
|
|
102
141
|
<script>
|
|
103
142
|
(function() {
|
data/lib/passive_queue.rb
CHANGED
|
@@ -9,17 +9,36 @@ require "passive_queue/web"
|
|
|
9
9
|
require "passive_queue/engine"
|
|
10
10
|
require "active_job/queue_adapters/passive_queue_adapter"
|
|
11
11
|
|
|
12
|
+
# PassiveQueue is a Rails queue adapter that embraces the zen of non-productivity.
|
|
13
|
+
# It accepts all jobs but executes none, achieving perfect reliability through strategic non-action.
|
|
12
14
|
module PassiveQueue
|
|
15
|
+
# Base error class for PassiveQueue-related errors
|
|
13
16
|
class Error < StandardError; end
|
|
14
17
|
|
|
18
|
+
# Returns the current PassiveQueue configuration instance
|
|
19
|
+
#
|
|
20
|
+
# @return [Configuration] the configuration instance
|
|
15
21
|
def self.configuration
|
|
16
22
|
@configuration ||= Configuration.new
|
|
17
23
|
end
|
|
18
24
|
|
|
25
|
+
# Configures PassiveQueue with a block
|
|
26
|
+
#
|
|
27
|
+
# @yield [Configuration] the configuration instance
|
|
28
|
+
# @return [void]
|
|
29
|
+
#
|
|
30
|
+
# @example
|
|
31
|
+
# PassiveQueue.configure do |config|
|
|
32
|
+
# config.zen_level = :transcendent
|
|
33
|
+
# config.silence_mode = true
|
|
34
|
+
# end
|
|
19
35
|
def self.configure
|
|
20
36
|
yield(configuration)
|
|
21
37
|
end
|
|
22
38
|
|
|
39
|
+
# Returns an array of zen quotes about passive processing
|
|
40
|
+
#
|
|
41
|
+
# @return [Array<String>] collection of zen wisdom
|
|
23
42
|
def self.zen_quotes
|
|
24
43
|
[
|
|
25
44
|
"The best job is the one never executed.",
|
|
@@ -35,6 +54,9 @@ module PassiveQueue
|
|
|
35
54
|
]
|
|
36
55
|
end
|
|
37
56
|
|
|
57
|
+
# Returns an array of philosophical thoughts about job processing
|
|
58
|
+
#
|
|
59
|
+
# @return [Array<String>] collection of deep philosophical reflections
|
|
38
60
|
def self.philosophical_thoughts
|
|
39
61
|
[
|
|
40
62
|
"If a job is scheduled but never runs, did it ever really exist?",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require_relative "lib/passive_queue/version"
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |spec|
|
|
4
|
+
spec.name = "passive_queue"
|
|
5
|
+
spec.version = PassiveQueue::VERSION
|
|
6
|
+
spec.authors = ["Maciej Mensfeld"]
|
|
7
|
+
spec.email = ["void@passivequeue.pro"]
|
|
8
|
+
|
|
9
|
+
spec.summary = "A Rails queue adapter that embraces the zen of non-productivity"
|
|
10
|
+
spec.description = "Rails queue adapter for mindful developers. Accepts all jobs, executes none. Perfect reliability through strategic non-action."
|
|
11
|
+
spec.homepage = "https://passivequeue.pro"
|
|
12
|
+
spec.license = "MIT"
|
|
13
|
+
spec.required_ruby_version = ">= 3.3.0"
|
|
14
|
+
|
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/mensfeld/passive_queue"
|
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/mensfeld/passive_queue/blob/main/CHANGELOG.md"
|
|
18
|
+
|
|
19
|
+
spec.files = Dir.chdir(__dir__) do
|
|
20
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
21
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
spec.executables = ['be']
|
|
26
|
+
spec.require_paths = ["lib"]
|
|
27
|
+
# NO runtime dependencies - true zen has no dependencies
|
|
28
|
+
end
|
data/renovate.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": [
|
|
4
|
+
"config:recommended"
|
|
5
|
+
],
|
|
6
|
+
"github-actions": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"pinDigests": true
|
|
9
|
+
},
|
|
10
|
+
"includePaths": [
|
|
11
|
+
"Gemfile",
|
|
12
|
+
"passive_queue.gemspec"
|
|
13
|
+
],
|
|
14
|
+
"packageRules": [
|
|
15
|
+
{
|
|
16
|
+
"matchManagers": [
|
|
17
|
+
"github-actions"
|
|
18
|
+
],
|
|
19
|
+
"minimumReleaseAge": "7 days"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: passive_queue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maciej Mensfeld
|
|
@@ -18,15 +18,19 @@ executables:
|
|
|
18
18
|
extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
|
20
20
|
files:
|
|
21
|
+
- ".ruby-version"
|
|
22
|
+
- ".yard-lint.yml"
|
|
21
23
|
- CHANGELOG.md
|
|
22
24
|
- Gemfile
|
|
23
25
|
- Gemfile.lock
|
|
24
26
|
- LICENSE
|
|
25
27
|
- README.md
|
|
28
|
+
- Rakefile
|
|
26
29
|
- bin/be
|
|
27
|
-
- html/
|
|
30
|
+
- html/index.html
|
|
28
31
|
- html/logo-dark.svg
|
|
29
32
|
- html/logo.svg
|
|
33
|
+
- html/web-ui.png
|
|
30
34
|
- lib/active_job/queue_adapters/passive_queue_adapter.rb
|
|
31
35
|
- lib/passive_queue.rb
|
|
32
36
|
- lib/passive_queue/adapter.rb
|
|
@@ -36,6 +40,8 @@ files:
|
|
|
36
40
|
- lib/passive_queue/railtie.rb
|
|
37
41
|
- lib/passive_queue/version.rb
|
|
38
42
|
- lib/passive_queue/web.rb
|
|
43
|
+
- passive_queue.gemspec
|
|
44
|
+
- renovate.json
|
|
39
45
|
homepage: https://passivequeue.pro
|
|
40
46
|
licenses:
|
|
41
47
|
- MIT
|
|
@@ -50,14 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
50
56
|
requirements:
|
|
51
57
|
- - ">="
|
|
52
58
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 3.
|
|
59
|
+
version: 3.3.0
|
|
54
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
61
|
requirements:
|
|
56
62
|
- - ">="
|
|
57
63
|
- !ruby/object:Gem::Version
|
|
58
64
|
version: '0'
|
|
59
65
|
requirements: []
|
|
60
|
-
rubygems_version: 3.6.
|
|
66
|
+
rubygems_version: 3.6.9
|
|
61
67
|
specification_version: 4
|
|
62
68
|
summary: A Rails queue adapter that embraces the zen of non-productivity
|
|
63
69
|
test_files: []
|