Skip to content

Conversation

0exp
Copy link
Member

@0exp 0exp commented Dec 9, 2024

hookable thread abort:

Rack::Timeout.add_on_thread_abort_hook  do |thread, app, env|
  # do something
end

per-endpoint timeouts:

Rack::Timeout.set_per_endpoint_service_timeout("/some/endpoint", 30) # in seconds

dynamic timeouts:

Rack::Timeout.dynamic_service_timeout = proc do |rack_request, rack_env|
   # rack_request is a Rack::Request
   # rack_env is a raw Rack's env variable from middleware stack

   # calculate Integer value (in seconds) or nil (treats as service_timeout)
end

@0exp 0exp changed the title Hookable thread abort (needed for inline RQL unlocking for some critical places of our business logic) Hookable thread abort (needed for inline RQL unlocking for some critical places of our business logic) + An Ability to timeout each endpoint separatly (with service_timeout) Jun 30, 2025
@0exp 0exp changed the title Hookable thread abort (needed for inline RQL unlocking for some critical places of our business logic) + An Ability to timeout each endpoint separatly (with service_timeout) Hookable Thread Abort (for RQL cleanup) + Per Endpoint Timeouts + Dynamic Timeouts Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants