Skip to content

Commit db7d51c

Browse files
phil-6excid3
andauthored
Update Documentation: Add details about how to vary queue priority (#494)
* Add details about how to vary queue priority * Update README.md --------- Co-authored-by: Chris Oliver <[email protected]>
1 parent 9b3f5af commit db7d51c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,29 @@ Each of these options are available for every delivery method (individual or bul
374374

375375
* `config.if` — Intended for a lambda or method; runs after the `wait` if configured; cancels the delivery method if returns falsey
376376
* `config.unless` — Intended for a lambda or method; runs after the `wait` if configured; cancels the delivery method if returns truthy
377+
378+
The following are evaluated in the context of the Notification so it can be customize to the recipient:
379+
377380
* `config.wait` — (Should yield an `ActiveSupport::Duration`) Delays the job that runs this delivery method for the given duration of time
378381
* `config.wait_until` — (Should yield a specific time object) Delays the job that runs this delivery method until the specific time specified
379-
* `config.queue` — Sets the ActiveJob queue name to be used for the job that runs this delivery method
382+
* `config.queue` — Sets the ActiveJob queue name to be used for the job that runs this delivery method.
383+
384+
When using a symbol, the matching method must be defined inside the `notification_methods` block:
385+
386+
```ruby
387+
# app/notifiers/message_notifier.rb
388+
class MessageNotifier < Noticed::Event
389+
deliver_by :delivery_method do |config|
390+
config.queue = :queue
391+
end
392+
393+
notification_methods do
394+
def queue
395+
"high_priority"
396+
end
397+
end
398+
end
399+
```
380400

381401
### 📨 Sending Notifications
382402

0 commit comments

Comments
 (0)