Class: AnyCable::Rails::Middlewares::Executor
- Inherits:
-
Middleware
- Object
- Middleware
- AnyCable::Rails::Middlewares::Executor
- Defined in:
- lib/anycable/rails/middlewares/executor.rb
Overview
Executor runs Rails executor for each call See guides.rubyonrails.org/v5.2.0/threading_and_code_execution.html#framework-behavior
Instance Attribute Summary collapse
-
#executor ⇒ Object
readonly
Returns the value of attribute executor.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(executor) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(executor) ⇒ Executor
11 12 13 |
# File 'lib/anycable/rails/middlewares/executor.rb', line 11 def initialize(executor) @executor = executor end |
Instance Attribute Details
#executor ⇒ Object (readonly)
Returns the value of attribute executor.
9 10 11 |
# File 'lib/anycable/rails/middlewares/executor.rb', line 9 def executor @executor end |
Instance Method Details
#call ⇒ Object
15 16 17 |
# File 'lib/anycable/rails/middlewares/executor.rb', line 15 def call(*) executor.wrap { yield } end |