HBClasses — Documentation on the basic classes

These classes makes up the basic set of class used for communication.

class HBClasses.HBClient(pb.Referenceable)

This identifies the client.

remote_queueUpdate()

This is called to tell the client that we have changed their queue.

Clients should now call remote_getJobs() to see what has changed.

Note

It is possiable to compare referance objects and get a meaningful result. To using == to work out what jobs have been added or removed is viable.

Note

This is achived by twisted using the .luid attribute.

remote_stopJob(Job)

This is called to get a client to stop working on a job.

Parameters:Job (HBJob) – The job to stop working on.
remote_shutdown()

The server is shutting down. All clients should stop work and exit.

class HBClasses.HBServer(pb.Root)

This is the root server object. This gets sent by twisted when a client connects.

remote_getQueue()

This is called by a client to signify that they are ready to except jobs.

Returns:A job queue
Return type:HBQueue
remote_loseQueue(Queue)

This is called by the client to tell the server that it is no longer capable of completing the passed HBQueue

Parameters:Queue (HBQueue) – The Queue that can’t be completed
class HBClasses.HBQueue(pb.Referenceable)

This holds a load of HBJob‘s and is passed to the clients so they know what to do.

remote_getJobs()

This gets a list of assined HBJobs from the server. The HBJob in index 0 should be executed first.

Returns:List of HBJob‘s.
Return type:list
class HBClasses.HBJob(pb.Referenceable)

This tells the client to do a specific task. These should have some sort of hierarchy to allow jobs to happen simultaneously. e.g. download one raw file while transcoding another.

remote_serveFiles()

Instructs the server to make the files nessary for the job avilable in an FTP location.

The location returned will be a folder location, all files contained within are nessary for the job.

Read Sending files for more info.

Returns:A URL to the FTP location of the format ftp://server:port/location
Return type:string
remote_returnFiles()

Instructs the server to open up an FTP location to return the file to.

Read Sending files for more info.

Returns:A URL to the FTP location of the format ftp://server:port/location
Return type:string
remote_getArgs()

Gets the list of arguments that need to be passed to handbrake. The list just needs to be prepended with a process name after which it can be pass stright to reactor.spawnProcess() as the arg keyword argument.

Returns:reactor.spawnProcess() arg list
Return type:list
remote_setStage(Stage)

This method sets the state of the job. The stage is an interger number between 1 and 5 which have the following meaning:

Number Short Description Long Description
1 Queued Nothing has happened to it, this is a jobs initial state
2 Transfering to client The jobs files are currently being transfered to a client
3 Transcoding The job is currenlty being transcoded and is in progress
4 Transfering to server The jobs files are being transfered back after transcoding
5 Complete The job is complete. All resulting files are back at the server
Parameters:Stage (int) – The current stage of the job
remote_setPercentage(Percentage)

This sets the percentage complete of the jobs current stage.

Parameters:Percentage (int) – Percent complete (0 - 100)
remote_setETA(Time)

Set the time till completion of the current stage.

Parameters:Time (int) – Time till completion in seconds.
remote_setSpeed(Speed)

Set the speed of the current stage. The unit of speed changes depending on the stage.

Stage Unit
2 and 4 MB/s
3 FPS
Parameters:Speed (int) – Speed of current stage

Project Versions

Previous topic

Welcome to Handbrake Distributed Scheduler’s documentation!

Next topic

Protocol — A description of how we communicate

This Page