@!macro abstract_executor_service_public_api @!visibility private
The set of possible fallback policies that may be set at thread pool creation.
@!macro [attach] executor_service_method_auto_terminate_setter
# File lib/concurrent/executor/executor_service.rb, line 285 def auto_terminate=(value) synchronize { self.ns_auto_terminate = value } end
@!macro [attach] executor_service_method_auto_terminate_question
# File lib/concurrent/executor/executor_service.rb, line 280 def auto_terminate? synchronize { ns_auto_terminate? } end
@!macro [attach] executor_service_method_kill
# File lib/concurrent/executor/executor_service.rb, line 255 def kill raise NotImplementedError end
@!macro [attach] executor_service_method_running_question
# File lib/concurrent/executor/executor_service.rb, line 265 def running? synchronize { ns_running? } end
@!macro [attach] executor_service_method_shutdown
# File lib/concurrent/executor/executor_service.rb, line 250 def shutdown raise NotImplementedError end
@!macro [attach] executor_service_method_shutdown_question
# File lib/concurrent/executor/executor_service.rb, line 275 def shutdown? synchronize { ns_shutdown? } end
# File lib/concurrent/executor/executor_service.rb, line 316 def execute(*args, &task) raise NotImplementedError end
Handler which executes the `fallback_policy` once the queue size reaches `max_queue`.
@param [Array] args the arguments to the task which is being handled.
@!visibility private
# File lib/concurrent/executor/executor_service.rb, line 297 def handle_fallback(*args) case fallback_policy when :abort raise RejectedExecutionError when :discard false when :caller_runs begin yield(*args) rescue => ex # let it fail log DEBUG, ex end true else fail "Unknown fallback policy #{fallback_policy}" end end
@!macro [attach] executor_service_method_kill_execution
Callback method called when the executor has been killed. The default behavior is to do nothing.
# File lib/concurrent/executor/executor_service.rb, line 332 def kill_execution # do nothing end
# File lib/concurrent/executor/executor_service.rb, line 342 def ns_auto_terminate=(value) case value when true AtExit.add(self) { terminate_at_exit } @auto_terminate = true when false AtExit.delete(self) @auto_terminate = false else raise ArgumentError end end
# File lib/concurrent/executor/executor_service.rb, line 338 def ns_auto_terminate? !!@auto_terminate end
@!macro [attach] executor_service_method_shutdown_execution
Callback method called when an orderly shutdown has completed. The default behavior is to signal all waiting threads.
# File lib/concurrent/executor/executor_service.rb, line 324 def shutdown_execution # do nothing end
Generated with the Darkfish Rdoc Generator 2.