aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/action_mailbox/inbound_email/routable.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-12-12 16:34:05 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-12-12 16:34:05 -0800
commit6edccec1b97af46d2133ce701d7c307d213da9c6 (patch)
tree934469bfd65565b0b17e09fac0fa36a85967f197 /app/models/action_mailbox/inbound_email/routable.rb
parent1df26841b34d065c111d9b4e2147c1f94ec70c7d (diff)
downloadrails-6edccec1b97af46d2133ce701d7c307d213da9c6.tar.gz
rails-6edccec1b97af46d2133ce701d7c307d213da9c6.tar.bz2
rails-6edccec1b97af46d2133ce701d7c307d213da9c6.zip
Basic docs for most classes
Diffstat (limited to 'app/models/action_mailbox/inbound_email/routable.rb')
-rw-r--r--app/models/action_mailbox/inbound_email/routable.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/action_mailbox/inbound_email/routable.rb b/app/models/action_mailbox/inbound_email/routable.rb
index 8f5b0ddd39..f042fa4f57 100644
--- a/app/models/action_mailbox/inbound_email/routable.rb
+++ b/app/models/action_mailbox/inbound_email/routable.rb
@@ -1,3 +1,8 @@
+# A newly received `InboundEmail` will not be routed synchronously as part of ingress controller's receival.
+# Instead, the routing will be done asynchronously, using a `RoutingJob`, to ensure maximum parallel capacity.
+#
+# By default, all newly created `InboundEmail` records that have the status of `pending`, which is the default,
+# will be scheduled for automatic, deferred routing.
module ActionMailbox::InboundEmail::Routable
extend ActiveSupport::Concern
@@ -5,10 +10,12 @@ module ActionMailbox::InboundEmail::Routable
after_create_commit :route_later, if: :pending?
end
+ # Enqueue a `RoutingJob` for this `InboundEmail`.
def route_later
ActionMailbox::RoutingJob.perform_later self
end
+ # Route this `InboundEmail` using the routing rules declared on the `ApplicationMailbox`.
def route
ApplicationMailbox.route self
end