Class: Contender::DirectExecutor

Inherits:
Executor
  • Object
show all
Defined in:
lib/contender/direct_executor.rb

Overview

Simple implementation of an executor that executes blocks in the calling thread

Instance Method Summary collapse

Instance Method Details

#execute(task = nil, &block) ⇒ undefined

Parameters:

  • task (Object) (defaults to: nil)

Returns:

  • (undefined)


7
8
9
# File 'lib/contender/direct_executor.rb', line 7

def execute(task = nil, &block)
  (task || block).call
end