easyop 0.1.1 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f110ef0a50149ab84f49b40209a05bbf152a995b802a8664c59ff95f0eb36ee1
4
- data.tar.gz: d35940933ad93ca75eba984ed9a83cad28045ba3492e6745bda41d4c95154ec5
3
+ metadata.gz: 9157dccd94c6847b4b83c01404b64d48ffe54f1f6f51a99e0263bb718a2acdc4
4
+ data.tar.gz: 62bbaa697722e2b0d1979bc5a20839fb9dc765ee22d989f404591129a8a72c01
5
5
  SHA512:
6
- metadata.gz: 47f9214496757ec818887f4d9372d03b3e4d26c488927de696637212d1b3aef42f3fcefda00fff85aa6f6452a4e93ecbbd674f859f38fda974b7b77bead059ff
7
- data.tar.gz: 5544728ce871c2eac2b9dfe6dfc278cc0c4f3cbe38f648ce031d82a55f16eb3400b29c34a883092a5167d07284beadc061ab6ab54eaac695cb5a87f6d8486d84
6
+ metadata.gz: 52fc250d99c11808462344afb74603081aa2dd35ca4f4d16ec263d19b3c098bba77ddcdda7963793483a9bfc0b04bd2cf63a70700c9756e0fb6b4610229ecc9f
7
+ data.tar.gz: 778348d6dc863bdda5816a32738ae2262c3948eb3711090b0a4412bc0678a9dc9b7c87e48cd937c3f1842e492f5be787c252c42f8ae9955191794cc9200dfc1e
data/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.2] — 2026-04-13
11
+
12
+ ### Added
13
+
14
+ - **`Plugins::Async` — `queue` DSL** — a new `queue` class method for declaring the default queue directly on an operation class (or a shared base class). This lets subclasses override the queue set at plugin install time without re-declaring the plugin:
15
+
16
+ ```ruby
17
+ class Weather::BaseOperation < ApplicationOperation
18
+ queue :weather # all Weather ops use the "weather" queue
19
+ end
20
+
21
+ class Weather::FetchForecast < Weather::BaseOperation
22
+ # inherits queue :weather automatically
23
+ end
24
+
25
+ class Weather::CleanupExpiredDays < Weather::BaseOperation
26
+ queue :low_priority # override just for this class
27
+ end
28
+ ```
29
+
30
+ Accepts both `Symbol` and `String`. The setting is inherited by subclasses and can be overridden at any level of the hierarchy.
31
+
10
32
  ## [0.1.1] — 2026-04-01
11
33
 
12
34
  ### Fixed
@@ -43,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
43
65
  - `examples/easyop_test_app/` — full Rails 8 blog application demonstrating all features in real-world code
44
66
  - `examples/usage.rb` — 13 runnable plain-Ruby examples
45
67
 
46
- [Unreleased]: https://github.com/pniemczyk/easyop/compare/v0.1.1...HEAD
68
+ [Unreleased]: https://github.com/pniemczyk/easyop/compare/v0.1.2...HEAD
69
+ [0.1.2]: https://github.com/pniemczyk/easyop/compare/v0.1.1...v0.1.2
47
70
  [0.1.1]: https://github.com/pniemczyk/easyop/compare/v0.1.0...v0.1.1
48
71
  [0.1.0]: https://github.com/pniemczyk/easyop/releases/tag/v0.1.0
data/README.md CHANGED
@@ -672,6 +672,20 @@ Newsletter::SendBroadcast.call_async(attrs, wait_until: Date.tomorrow.noon)
672
672
  Newsletter::SendBroadcast.call_async(attrs, queue: "low_priority")
673
673
  ```
674
674
 
675
+ **`queue` DSL** — declare the default queue directly on a class (or a shared base class) instead of at plugin install time:
676
+
677
+ ```ruby
678
+ class Weather::BaseOperation < ApplicationOperation
679
+ queue :weather # all Weather ops use the "weather" queue by default
680
+ end
681
+
682
+ class Weather::CleanupExpiredDays < Weather::BaseOperation
683
+ queue :low_priority # override just for this class
684
+ end
685
+ ```
686
+
687
+ The `queue` setting is inherited by subclasses and can be overridden at any level. Accepts `Symbol` or `String`. A per-call `queue:` argument to `.call_async` always takes precedence.
688
+
675
689
  **ActiveRecord objects** are serialized by `(class, id)` and re-fetched in the job:
676
690
 
677
691
  ```ruby
@@ -27,6 +27,18 @@ module Easyop
27
27
  end
28
28
 
29
29
  module ClassMethods
30
+ # Declares a non-default queue for this operation class and its subclasses.
31
+ #
32
+ # @example
33
+ # class Weather::BaseOperation < ApplicationOperation
34
+ # queue :weather
35
+ # end
36
+ #
37
+ # @param name [String, Symbol] queue name
38
+ def queue(name)
39
+ @_async_default_queue = name.to_s
40
+ end
41
+
30
42
  # Enqueue the operation as a background job.
31
43
  #
32
44
  # MyOp.call_async(email: "x@y.com")
@@ -1,3 +1,3 @@
1
1
  module Easyop
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Niemczyk