Class: Opee::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/opee/job.rb

Overview

A holder for data processed by Actors. It lends support to the use of Collectors if the support behavior is desired in the Job instead of the Collector itself.

Instance Method Summary (collapse)

Constructor Details

- (Job) initialize

Returns a new instance of Job



8
9
# File 'lib/opee/job.rb', line 8

def initialize()
end

Instance Method Details

- (true|false) complete?(token)

Returns true if the job has been processed by all paths converging on the collector. The default behavior is to raise a NotImplementedError.

Parameters:

  • token (Object)

    current token value or nil for the first token value

Returns:

  • (true|false)

    an indication of wether the job has completed all paths

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/opee/job.rb', line 31

def complete?(token)
  raise NotImplementedError.new("complete?() not implemented")
end

- (Object) key

Returns the key associated with the job. The default behavior is to raise a NotImplementedError.

Returns:

  • (Object)

    a key for looking up the token in the cache



14
15
16
# File 'lib/opee/job.rb', line 14

def key()
  object_id()
end

- (Object) update_token(token, path_id)

Updates the token associated with the job. The default behavior is to raise a NotImplementedError.

Parameters:

  • token (Object)

    current token value or nil for the first token value

  • path_id (Object)

    an indicator of the path if used

Returns:

  • (Object)

    a token to keep track of the progress of the job

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/opee/job.rb', line 23

def update_token(token, path_id)
  raise NotImplementedError.new("update_token() not implemented")
end