Class: Contender::Future Abstract

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

Overview

This class is abstract.

Direct Known Subclasses

FutureTask

Instance Method Summary collapse

Instance Method Details

#cancel(should_interrupt) ⇒ Boolean

This method is abstract.

Returns True if this future was cancelled.

Parameters:

  • should_interrupt (Boolean)

Returns:

  • (Boolean)

    True if this future was cancelled

Raises:

  • (NotImplementedError)


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

def cancel(should_interrupt)
  raise NotImplementedError
end

#cancelled?Boolean

This method is abstract.

Returns true if this future was cancelled before it could complete

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/contender/future.rb', line 15

def cancelled?
  raise NotImplementedError
end

#done?Boolean

This method is abstract.

Returns true if this future was either cancelled or completed

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/contender/future.rb', line 23

def done?
  raise NotImplementedError
end

#result(timeout = nil) ⇒ Object

This method is abstract.

Returns The result of the future.

Parameters:

  • timeout (Integer) (defaults to: nil)

    Time to wait for the result

Returns:

  • (Object)

    The result of the future

Raises:



33
34
35
# File 'lib/contender/future.rb', line 33

def result(timeout = nil)
  raise NotImplementedError
end