Workunit API

From Web Computing Documentation
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
In order to communicate with the framework the actual distributed application needs to use the JavaScript functions of the workunit interface contained in the file ''worker.js''. These functions are
 
In order to communicate with the framework the actual distributed application needs to use the JavaScript functions of the workunit interface contained in the file ''worker.js''. These functions are
   
*[[js.evalJson]](object) — Evaluates a JSON string and returns the corresponding object
 
*[[js.toJson]](object) — Creates a JSON string from a given object
 
*[[js.output.write]](name, string) — Writes the given data to the selected output stream
 
*[[js.output.writeLine]](name, string) — Writes the given data with newline to the selected output stream
 
 
*[[js.input.read]](name) — Reads the input corresponding to the given name
 
*[[js.input.read]](name) — Reads the input corresponding to the given name
 
*[[js.work.setProgress]](rate) — Reports the percentage of progress to the framework
 
*[[js.work.setProgress]](rate) — Reports the percentage of progress to the framework
Line 10: Line 6:
 
*[[js.work.getCheckpoint]]( ) — Retrieves the last checkpoint from the persistent storage
 
*[[js.work.getCheckpoint]]( ) — Retrieves the last checkpoint from the persistent storage
 
*[[js.work.debug]](string) — Sends a debug message to the framework.
 
*[[js.work.debug]](string) — Sends a debug message to the framework.
+
*[[js.output.write]](name, string) — Writes the given data to the selected output stream
  +
*[[js.output.writeLine]](name, string) — Writes the given data with newline to the selected output stream
  +
*[[js.evalJson]](object) — Evaluates a JSON string and returns the corresponding object
  +
*[[js.toJson]](object) — Creates a JSON string from a given object
   
 
To be implemented
 
To be implemented

Revision as of 16:29, 11 July 2011

In order to communicate with the framework the actual distributed application needs to use the JavaScript functions of the workunit interface contained in the file worker.js. These functions are

  • js.input.read(name) — Reads the input corresponding to the given name
  • js.work.setProgress(rate) — Reports the percentage of progress to the framework
  • js.work.setCheckpoint(object) — Saves checkpoint data to the persistent storage
  • js.work.getCheckpoint( ) — Retrieves the last checkpoint from the persistent storage
  • js.work.debug(string) — Sends a debug message to the framework.
  • js.output.write(name, string) — Writes the given data to the selected output stream
  • js.output.writeLine(name, string) — Writes the given data with newline to the selected output stream
  • js.evalJson(object) — Evaluates a JSON string and returns the corresponding object
  • js.toJson(object) — Creates a JSON string from a given object

To be implemented

  • js.canvas.clear
  • js.canvas.beginPath
  • js.canvas.moveTo
  • js.canvas.lineTo
  • js.canvas.arc
  • js.canvas.stroke
  • js.canvas.fill
  • js.canvas.fillRect
  • js.canvas.fillText
  • js.canvas.setFillStyle
  • js.canvas.setLineWidth
  • js.canvas.setFont
  • js.canvas.draw
Personal tools
Modules