snerdmq 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -26
- data/snerdmq.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 33038820de67044b31b1d87e4c32ba2d2cd76b2b9ad484232d0cdf6b29006987
|
|
4
|
+
data.tar.gz: c143aae45679572e6c520feb53fe91a7f4a9c8883ea880c671552dc63884eb28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1191264eeb1e42ab3b2cef6ac45a89253f6d196fe3cdf057487a61b2c0a3de64a2f13bb1a0989552079572ae4908c8fdce2e0582a24d5ec15d7e1eb9a4a3b30f
|
|
7
|
+
data.tar.gz: c28eda76ce86f6fb4e1884248fed72f10e4bc824b29e7a716c8a3a3b69477afaf7dbb7ca17c3489e21d85172a58dbae2aed31edd3c3071d0ff8fcf26af12fefd
|
data/README.md
CHANGED
|
@@ -272,12 +272,7 @@ Simply pass an array of parent task IDs to the `trigger_after_ids` parameter whe
|
|
|
272
272
|
|
|
273
273
|
### 🍕 Sharded Queues (Scaling Out)
|
|
274
274
|
|
|
275
|
-
SnerdMQ natively supports distributed execution across multiple servers while acting as a single logical queue. Just mount a shared storage drive (like AWS EFS) and boot multiple daemons. They will automatically lock and negotiate ownership of shards. No config required in the SDK for enqueueing! Just tell the daemon how many shards to claim on boot
|
|
276
|
-
|
|
277
|
-
```ruby
|
|
278
|
-
# Boot a multi-tenant daemon that owns up to 4 shards locally
|
|
279
|
-
queue = SnerdQueue.new(max_local_shards: 4)
|
|
280
|
-
```
|
|
275
|
+
SnerdMQ natively supports distributed execution across multiple servers while acting as a single logical queue. Just mount a shared storage drive (like AWS EFS) and boot multiple daemons. They will automatically lock and negotiate ownership of shards. No config required in the SDK for enqueueing! Just tell the daemon how many shards to claim on boot.
|
|
281
276
|
|
|
282
277
|
```ruby
|
|
283
278
|
# 1. Worker Pools: Route tasks to the 'urgent' pool
|
|
@@ -297,41 +292,25 @@ queue.enqueue(
|
|
|
297
292
|
)
|
|
298
293
|
```
|
|
299
294
|
|
|
300
|
-
|
|
301
295
|
### 🕒 Cron & Scheduled Jobs
|
|
302
296
|
```ruby
|
|
303
297
|
# Run every day at 08:00
|
|
304
|
-
queue.enqueue(
|
|
305
|
-
task_id: 'daily-digest',
|
|
306
|
-
task_type: 'send_email',
|
|
307
|
-
data: { template: 'daily' },
|
|
308
|
-
cron: '0 8 * * *'
|
|
309
|
-
)
|
|
298
|
+
queue.enqueue(task_id: 'daily-digest', task_type: 'send_email', data: { template: 'daily' }, cron: '0 8 * * *')
|
|
310
299
|
```
|
|
311
300
|
|
|
312
301
|
### 🛑 Hard Timeouts
|
|
313
302
|
```ruby
|
|
314
303
|
# Forcefully kill if running > 5 mins
|
|
315
|
-
queue.enqueue(
|
|
316
|
-
task_id: 'risky-task',
|
|
317
|
-
task_type: 'process_data',
|
|
318
|
-
data: {},
|
|
319
|
-
max_execution_seconds: 300
|
|
320
|
-
)
|
|
304
|
+
queue.enqueue(task_id: 'risky-task', task_type: 'process_data', data: {}, max_execution_seconds: 300)
|
|
321
305
|
```
|
|
322
306
|
|
|
323
307
|
### 🌐 Webhook Callbacks
|
|
324
308
|
```ruby
|
|
325
309
|
# Execute via HTTP instead of local handlers
|
|
326
|
-
queue.enqueue(
|
|
327
|
-
task_id: 'serverless-task',
|
|
328
|
-
task_type: 'resize_image',
|
|
329
|
-
data: { img: 'cat.jpg' },
|
|
330
|
-
webhook_url: 'https://api.example.com/webhooks/snerdmq'
|
|
331
|
-
)
|
|
310
|
+
queue.enqueue(task_id: 'serverless-task', task_type: 'resize_image', data: { img: 'cat.jpg' }, webhook_url: 'https://api.example.com/webhooks/snerdmq')
|
|
332
311
|
```
|
|
333
312
|
|
|
334
|
-
|
|
313
|
+
|
|
335
314
|
|
|
336
315
|
|
|
337
316
|
## Architecture Best Practices
|
|
@@ -370,3 +349,5 @@ trap('TERM') { queue.shutdown; exit }
|
|
|
370
349
|
|
|
371
350
|
queue.start_listening
|
|
372
351
|
```
|
|
352
|
+
|
|
353
|
+
*Built with ❤️ for John Wick tier engineering.*
|
data/snerdmq.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snerdmq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Greyhands2
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|