I want to achieve the following behavior in my controllers' action without the usage of Timeout module:

```
class AdminController < ApplicationController
  def example
    Timeout.timeout(params[:timeout].to_i) do
      ... # try to process the request within params[:timeout] seconds
    end
  rescue Timeout::Error
    render nothing: true, status: :gateway_timeout
  end
end

```

I want to avoid the usage of Timeout because it's causing many bugs in my application, including database connection leaks. Some other problems reported at:
<http://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/>