Class: Rage::Configuration::BlockingOperationPool

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/configuration.rb

Instance Attribute Summary collapse

Instance Attribute Details

#enabledBoolean

Enable a background thread pool for offloading native calls that can be executed outside the GVL, freeing the main server thread to continue processing other requests. This acts as a preemption mechanism: native calls won't stall requests, as the OS will context-switch between the server thread and the worker threads. Defaults to false.

Examples:

Enable the thread pool

Rage.configure do
  config.blocking_operation_pool.enabled = true
end

Returns:

  • (Boolean)


1109
1110
1111
# File 'lib/rage/configuration.rb', line 1109

def enabled
  @enabled
end

#sizeInteger

Specify the number of threads in the pool. Defaults to 1. A single thread is sufficient in most cases because the pool's goal is context switching, not parallelization.

Returns:

  • (Integer)


1109
# File 'lib/rage/configuration.rb', line 1109

attr_accessor :enabled, :size