Package park :: Package core :: Module server :: Class ServerProxy

Class ServerProxy

source code


Client side view of a service.

Inherit from here when creating new service types.

Instance Methods
 
jobs(self, filter=None)
Return a list of the jobs on the service which the user can access.
source code
 
submit(self, request=None, monitor=None, when=None)
Add a new request to the job queue.
source code
 
fetch(self, id)
Grab a copy of the named job from the server.
source code
 
status(self, id) source code
 
abort(self, id)
Abort a job.
source code
 
control(self, id, message)
Send a control message to the job.
source code
 
wait(self, jobid=None, timeout=None)
Wait for the job to complete.
source code

Inherited from Server: __enter__, __leave__, connect, set_email, set_tags, start, stop

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

jobs(self, filter=None)

source code 

Return a list of the jobs on the service which the user can access.

This list will include all jobs owned by the user on the remote service that have not yet been archived or deleted.

Use a filter to select jobs of a particular type.

Overrides: Server.jobs

submit(self, request=None, monitor=None, when=None)

source code 

Add a new request to the job queue. Messages from the job are sent to monitor.

Returns the job id for the request, which is unique to the queue.

Overrides: Server.submit

fetch(self, id)

source code 

Grab a copy of the named job from the server.

This should include enough information to reconstruct the job request.

control(self, id, message)

source code 

Send a control message to the job.

Message should be pickleable. The structure of the message is specific to the type of job. Messages will be queued in the job control queue on the service until the job is ready to process them. If the job has already been terminated then the message will be ignored.

Control is asynchronous. Rather than trying to set up, e.g., job.population() which returns the current population from a simulation, instead set up job.get_population() which sends a control message to retrieve the population and set up an on_population() method which is called when the population is received on the job message stream.

wait(self, jobid=None, timeout=None)

source code 

Wait for the job to complete.

This is used in scripts to impose a synchronous interface to the fitting service.