Class: Plutonium::Interaction::Async::Configuration
- Inherits:
-
Object
- Object
- Plutonium::Interaction::Async::Configuration
- Defined in:
- lib/plutonium/interaction/async/configuration.rb
Overview
Configuration for async interactions. Mirrors
Plutonium::Wizard::Configuration: enabled gates both the subsystem and
its migrations (see Plutonium::Migrations).
Instance Attribute Summary collapse
-
#attachment_backend ⇒ Symbol?
The storage backend used to stage an attachment attribute into the run's options —
:active_storageor:shrine. -
#enabled ⇒ Boolean
Whether runs (and their migrations) are enabled.
-
#queue ⇒ Symbol
ActiveJob queue for run jobs.
-
#stall_after ⇒ ActiveSupport::Duration
How long a run may sit with no progress write before ReapJob considers it stalled.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
30 31 32 33 34 |
# File 'lib/plutonium/interaction/async/configuration.rb', line 30 def initialize @enabled = false @queue = :default @stall_after = 1.hour end |
Instance Attribute Details
#attachment_backend ⇒ Symbol?
Returns the storage backend used to stage an attachment
attribute into the run's options — :active_storage or :shrine.
nil falls back to config.attachment_backend, then to auto-detection.
A file cannot ride the options column: it is JSON, and the request's tempfile is gone by the time the job runs. So an attachment attribute is uploaded to the backend's cache at dispatch and carried as its token. This is the knob for which backend does that, for runs alone.
28 29 30 |
# File 'lib/plutonium/interaction/async/configuration.rb', line 28 def @attachment_backend end |
#enabled ⇒ Boolean
Returns whether runs (and their migrations) are enabled.
11 12 13 |
# File 'lib/plutonium/interaction/async/configuration.rb', line 11 def enabled @enabled end |
#queue ⇒ Symbol
Returns ActiveJob queue for run jobs.
14 15 16 |
# File 'lib/plutonium/interaction/async/configuration.rb', line 14 def queue @queue end |
#stall_after ⇒ ActiveSupport::Duration
Returns how long a run may sit with no progress write before ReapJob considers it stalled.
18 19 20 |
# File 'lib/plutonium/interaction/async/configuration.rb', line 18 def stall_after @stall_after end |