Class: Contender::Executor Abstract

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

Overview

This class is abstract.

Represents a mechanism for executing submitted blocks

This interface decouples task submission from the way that tasks will be run, including details of thread use, scheduling, etc.

Direct Known Subclasses

DirectExecutor, ExecutorService

Instance Method Summary collapse

Instance Method Details

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

This method is abstract.

Executes the given block at some time in the future

The block may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the implementation.

Parameters:

  • task (Object) (defaults to: nil)

Returns:

  • (undefined)

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/contender/executor.rb', line 17

def execute(task = nil, &block)
  raise NotImplementedError
end