Package gofer :: Package agent :: Module rmi :: Class Task
[hide private]
[frames] | no frames]

Class Task

source code

An RMI task to be scheduled on the plugin's thread pool.

Instance Methods [hide private]
 
__init__(self, plugin, envelope, producer, commit) source code
 
__call__(self, *args, **options)
Dispatch received request.
source code
 
__call(self)
Dispatch received request.
source code
 
missed(self)
Check the window.
source code
 
expired(self)
Check the TTL.
source code
 
sendstarted(self, envelope)
Send the a status update if requested.
source code
 
sendreply(self, envelope, result)
Send the reply if requested.
source code
Class Variables [hide private]
  context = Local()
Instance Variables [hide private]
Envelope envelope
A gofer messaging envelope.
Plugin plugin
A plugin.
Producer producer
An AMQP message producer.
float ts
Timestamp
float ttl
The task time-to-live.
dict window
The window in which the task is valid.
Method Details [hide private]

__init__(self, plugin, envelope, producer, commit)
(Constructor)

source code 
Parameters:
  • plugin (Plugin) - A plugin.
  • envelope (Envelope) - A gofer messaging envelope.
  • producer (Producer) - An AMQP message producer.
  • commit (callable) - Transaction commit function.

missed(self)

source code 

Check the window.

Raises:

expired(self)

source code 

Check the TTL.

Raises:

sendstarted(self, envelope)

source code 

Send the a status update if requested.

Parameters:
  • envelope (Envelope) - The received envelope.

sendreply(self, envelope, result)

source code 

Send the reply if requested.

Parameters:
  • envelope (Envelope) - The received envelope.
  • result (object) - The request result.