Package fcp :: Module node :: Class JobTicket
[hide private]
[frames] | no frames]

Class JobTicket

source code

A JobTicket is an object returned to clients making asynchronous requests. It puts them in control of how they manage n concurrent requests.

When you as a client receive a JobTicket, you can choose to:

Attributes of interest:

Instance Methods [hide private]
 
__init__(self, node, id, cmd, kw, **opts)
You should never instantiate a JobTicket object yourself
source code
 
isComplete(self)
Returns True if the job has been completed
source code
 
wait(self, timeout=None)
Waits forever (or for a given timeout) for a job to complete
source code
 
waitTillReqSent(self)
Waits till the request has been sent to node
source code
 
getResult(self)
Returns result of job, or None if job still not complete
source code
 
callback(self, status, value)
This will be replaced in job ticket instances wherever user provides callback arguments
source code
 
cancel(self)
Cancels the job, if it is persistent
source code
 
_appendMsg(self, msg) source code
 
_putResult(self, result)
Called by manager thread to indicate job is complete, and submit a result to be picked up by client
source code
 
__repr__(self) source code
 
defaultLogger(self, level, msg) source code
Method Details [hide private]

getResult(self)

source code 

Returns result of job, or None if job still not complete

If result is an exception object, then raises it

cancel(self)

source code 

Cancels the job, if it is persistent

Does nothing if the job was not persistent