The XHTML WYSIWYG Editor For Desktop & Web Applications

Distributed Computing

In a multi-server environment, it may be desirable to distribute the workload over multiple servers. For example, specialised software needed to complete part of a task may only be available on a remote machine, or completing a task on a single machine might result in putting too much strain on that machine.

The following use-case demonstrates how ScriptQ can be used to facilitate intra-server communication. In this example, you are building a Web application where vistors to the site upload Microsoft Word documents that need to be converted to PDF files. The process of converting Word files to PDF can be very resource intensive and time consuming, and so performing the conversion on the same server as the Web site will limit the server's ability to serve Web pages. The optimal solution would therefore be to offload the PDF conversion process to one or more other servers as shown in the illustration below.

Illustration of a single Web server communicating with multiple PDF servers.

By installing ScriptQ on the Web server and on the PDF servers, files can be moved between the servers using the Upload() method. For example:

  1. ScriptQ.Upload "C:\Temp\file.doc", , "", 9000

Once a file is uploaded to a remote PDF server, a job (script) that will process the uploaded file can be instantiated from a template file on a remote server using the Instantiate() method. For example:

  1. ScriptQ.Instantiate "Convert To PDF.xml", , Array("file.doc"), "", 9000

Once the PDF conversion is completed, the job running on a PDF server can use the same API (Upload() and Instantiate() methods) to send the PDF file back to the Web server.

In addition to facilitating communication between servers, ScriptQ can queue and re-execute failed jobs. Continuing with the PDF conversion use-case, if the Web server fails to communicate with a PDF server due to network problems, or if the PDF server is temporarily unavailable, ScriptQ can be configured to wait and re-execute the job. This overcomes many temporary problems associated with distributed computing.