Sha256: 06c12db68c885086b549c8dbafd62e822db3ce92380f9cf8f5df563f47a954be

Contents?: true

Size: 759 Bytes

Versions: 36

Compression:

Stored size: 759 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

36 entries across 36 versions & 1 rubygems

Version Path
foreman-tasks-10.0.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-10.0.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-10.0.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.2.3 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.2.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.2.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.2.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.1.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.0.4 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.1.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.0.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.0.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-8.3.3 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-9.0.0 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-8.2.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-8.1.4 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-8.3.2 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-8.3.1 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-8.1.3 app/lib/actions/middleware/rails_executor_wrap.rb
foreman-tasks-8.3.0 app/lib/actions/middleware/rails_executor_wrap.rb