Class: Contender::Pool::ExecutionByCallerPolicy

Inherits:
RejectionPolicy show all
Defined in:
lib/contender/pool/rejection_policy.rb

Overview

Rejection policy that executes the task in the calling thread

Instance Method Summary collapse

Instance Method Details

#on_rejection(task, executor) ⇒ undefined

Parameters:

Returns:

  • (undefined)


19
20
21
22
# File 'lib/contender/pool/rejection_policy.rb', line 19

def on_rejection(task, executor)
  return if executor.shutdown?
  task.call
end