aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailbox/app/jobs/action_mailbox
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-12-26 16:18:42 -0500
committerGeorge Claghorn <george@basecamp.com>2018-12-26 16:18:42 -0500
commit6c168aaffb37c62dee6c895a22e240e5552be669 (patch)
treeb081b79a1088d9bc2bad0ee9f85fd4d7e5cc3638 /actionmailbox/app/jobs/action_mailbox
parent11a8ba12723c919397c8ccc0b4cf2e9f50da99ed (diff)
downloadrails-6c168aaffb37c62dee6c895a22e240e5552be669.tar.gz
rails-6c168aaffb37c62dee6c895a22e240e5552be669.tar.bz2
rails-6c168aaffb37c62dee6c895a22e240e5552be669.zip
Nest Action Mailbox classes in the API docs
Diffstat (limited to 'actionmailbox/app/jobs/action_mailbox')
-rw-r--r--actionmailbox/app/jobs/action_mailbox/incineration_job.rb28
-rw-r--r--actionmailbox/app/jobs/action_mailbox/routing_job.rb14
2 files changed, 23 insertions, 19 deletions
diff --git a/actionmailbox/app/jobs/action_mailbox/incineration_job.rb b/actionmailbox/app/jobs/action_mailbox/incineration_job.rb
index b12ff6f88e..224c9329a5 100644
--- a/actionmailbox/app/jobs/action_mailbox/incineration_job.rb
+++ b/actionmailbox/app/jobs/action_mailbox/incineration_job.rb
@@ -1,20 +1,22 @@
# frozen_string_literal: true
-# You can configure when this `IncinerationJob` will be run as a time-after-processing using the
-# `config.action_mailbox.incinerate_after` or `ActionMailbox.incinerate_after` setting.
-#
-# Since this incineration is set for the future, it'll automatically ignore any `InboundEmail`s
-# that have already been deleted and discard itself if so.
-class ActionMailbox::IncinerationJob < ActiveJob::Base
- queue_as { ActionMailbox.queues[:incineration] }
+module ActionMailbox
+ # You can configure when this `IncinerationJob` will be run as a time-after-processing using the
+ # `config.action_mailbox.incinerate_after` or `ActionMailbox.incinerate_after` setting.
+ #
+ # Since this incineration is set for the future, it'll automatically ignore any `InboundEmail`s
+ # that have already been deleted and discard itself if so.
+ class IncinerationJob < ActiveJob::Base
+ queue_as { ActionMailbox.queues[:incineration] }
- discard_on ActiveRecord::RecordNotFound
+ discard_on ActiveRecord::RecordNotFound
- def self.schedule(inbound_email)
- set(wait: ActionMailbox.incinerate_after).perform_later(inbound_email)
- end
+ def self.schedule(inbound_email)
+ set(wait: ActionMailbox.incinerate_after).perform_later(inbound_email)
+ end
- def perform(inbound_email)
- inbound_email.incinerate
+ def perform(inbound_email)
+ inbound_email.incinerate
+ end
end
end
diff --git a/actionmailbox/app/jobs/action_mailbox/routing_job.rb b/actionmailbox/app/jobs/action_mailbox/routing_job.rb
index fc3388daff..4ddf6e4231 100644
--- a/actionmailbox/app/jobs/action_mailbox/routing_job.rb
+++ b/actionmailbox/app/jobs/action_mailbox/routing_job.rb
@@ -1,11 +1,13 @@
# frozen_string_literal: true
-# Routing a new InboundEmail is an asynchronous operation, which allows the ingress controllers to quickly
-# accept new incoming emails without being burdened to hang while they're actually being processed.
-class ActionMailbox::RoutingJob < ActiveJob::Base
- queue_as { ActionMailbox.queues[:routing] }
+module ActionMailbox
+ # Routing a new InboundEmail is an asynchronous operation, which allows the ingress controllers to quickly
+ # accept new incoming emails without being burdened to hang while they're actually being processed.
+ class RoutingJob < ActiveJob::Base
+ queue_as { ActionMailbox.queues[:routing] }
- def perform(inbound_email)
- inbound_email.route
+ def perform(inbound_email)
+ inbound_email.route
+ end
end
end