Sha256: f112fc46b48712f9d2cb4c79dea9b56852c58ea397d3f48c8df6984f1a41cc44

Contents?: true

Size: 755 Bytes

Versions: 81

Compression:

Stored size: 755 Bytes

Contents

module Actions
  module Middleware
    # In development with Rails auto-reloading and using `sync_task` method,
    # it could lead to dead-locking due to the Rails main thread locking the
    # the class loader.
    #
    # This middleware marks the part of the code that can
    # use the auto-loader so that Rails know they should avoid the locking there.
    # See https://github.com/ruby-concurrency/concurrent-ruby/issues/585#issuecomment-256131537
    # for more details.
    class RailsExecutorWrap < Dynflow::Middleware
      def run(*args)
        Rails.application.executor.wrap do
          pass(*args)
        end
      end

      def finalize
        Rails.application.executor.wrap do
          pass
        end
      end
    end
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
foreman-tasks-0.14.4 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.14.3 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.14.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.14.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.11.3 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.14.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.13.4 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.13.3 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.13.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.13.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.13.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.12.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.11.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.12.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.12.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.11.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.10.9 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.11.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.10.8 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-0.10.7 app/lib/actions/middleware/rails_executor_wrap.rb