Skip to content

Commit

Permalink
Update Documentation: Add details about how to vary queue priority (#494
Browse files Browse the repository at this point in the history
)

* Add details about how to vary queue priority

* Update README.md

---------

Co-authored-by: Chris Oliver <[email protected]>
  • Loading branch information
phil-6 and excid3 authored Oct 14, 2024
1 parent 9b3f5af commit db7d51c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,29 @@ Each of these options are available for every delivery method (individual or bul

* `config.if` — Intended for a lambda or method; runs after the `wait` if configured; cancels the delivery method if returns falsey
* `config.unless` — Intended for a lambda or method; runs after the `wait` if configured; cancels the delivery method if returns truthy

The following are evaluated in the context of the Notification so it can be customize to the recipient:

* `config.wait` — (Should yield an `ActiveSupport::Duration`) Delays the job that runs this delivery method for the given duration of time
* `config.wait_until` — (Should yield a specific time object) Delays the job that runs this delivery method until the specific time specified
* `config.queue` — Sets the ActiveJob queue name to be used for the job that runs this delivery method
* `config.queue` — Sets the ActiveJob queue name to be used for the job that runs this delivery method.

When using a symbol, the matching method must be defined inside the `notification_methods` block:

```ruby
# app/notifiers/message_notifier.rb
class MessageNotifier < Noticed::Event
deliver_by :delivery_method do |config|
config.queue = :queue
end
notification_methods do
def queue
"high_priority"
end
end
end
```

### 📨 Sending Notifications

Expand Down

0 comments on commit db7d51c

Please sign in to comment.