--- a/eric6/Documentation/Source/eric6.Utilities.BackgroundService.html Wed Sep 25 19:40:31 2019 +0200 +++ b/eric6/Documentation/Source/eric6.Utilities.BackgroundService.html Wed Sep 25 19:42:44 2019 +0200 @@ -18,39 +18,50 @@ </style> </head> -<body><a NAME="top" ID="top"></a> +<body> +<a NAME="top" ID="top"></a> <h1>eric6.Utilities.BackgroundService</h1> + <p> Module implementing a background service for the various checkers and other python interpreter dependent functions. </p> <h3>Global Attributes</h3> + <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> + <table> + <tr> <td><a href="#BackgroundService">BackgroundService</a></td> <td>Class implementing the main part of the background service.</td> </tr> </table> <h3>Functions</h3> + <table> <tr><td>None</td></tr> </table> -<hr /><hr /> +<hr /> +<hr /> <a NAME="BackgroundService" ID="BackgroundService"></a> <h2>BackgroundService</h2> + <p> Class implementing the main part of the background service. -</p><h3>Signals</h3> +</p> +<h3>Signals</h3> <dl> + <dt>batchJobDone(function, language)</dt> <dd> emitted to indicate the end of a batch job (str, str) -</dd><dt>serviceNotAvailable(function, language, filename, message)</dt> +</dd> +<dt>serviceNotAvailable(function, language, filename, message)</dt> <dd> emitted to indicate the non-availability of a service function (str, str, str, str) @@ -59,235 +70,317 @@ <h3>Derived from</h3> QTcpServer <h3>Class Attributes</h3> + <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> + <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> + <table> + <tr> <td><a href="#BackgroundService.__init__">BackgroundService</a></td> <td>Constructor of the BackgroundService class.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.__processQueue">__processQueue</a></td> <td>Private method to take the next service request and send it to the client.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.__receive">__receive</a></td> <td>Private method to receive the response from the clients.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.__send">__send</a></td> <td>Private method to send a job request to one of the clients.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.__startExternalClient">__startExternalClient</a></td> <td>Private method to start the background client as external process.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.enqueueRequest">enqueueRequest</a></td> <td>Public method implementing a queued processing of incomming events.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.on_disconnectSocket">on_disconnectSocket</a></td> <td>Private slot called when connection to a client is lost.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.on_newConnection">on_newConnection</a></td> <td>Private slot for new incomming connections from the clients.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.preferencesOrProjectChanged">preferencesOrProjectChanged</a></td> <td>Public slot to restart the built in languages.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.requestCancel">requestCancel</a></td> <td>Public method to ask a batch job to terminate.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.restartService">restartService</a></td> <td>Public method to restart a given lanuage.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.serviceConnect">serviceConnect</a></td> <td>Public method to announce a new service to the background service/client.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.serviceDisconnect">serviceDisconnect</a></td> <td>Public method to remove the service from the service list.</td> -</tr><tr> +</tr> +<tr> <td><a href="#BackgroundService.shutdown">shutdown</a></td> <td>Public method to cleanup the connections and processes when eric is shutting down.</td> </tr> </table> <h3>Static Methods</h3> + <table> <tr><td>None</td></tr> </table> + <a NAME="BackgroundService.__init__" ID="BackgroundService.__init__"></a> <h4>BackgroundService (Constructor)</h4> <b>BackgroundService</b>(<i></i>) + <p> Constructor of the BackgroundService class. -</p><a NAME="BackgroundService.__processQueue" ID="BackgroundService.__processQueue"></a> +</p> +<a NAME="BackgroundService.__processQueue" ID="BackgroundService.__processQueue"></a> <h4>BackgroundService.__processQueue</h4> <b>__processQueue</b>(<i></i>) + <p> Private method to take the next service request and send it to the client. -</p><a NAME="BackgroundService.__receive" ID="BackgroundService.__receive"></a> +</p> +<a NAME="BackgroundService.__receive" ID="BackgroundService.__receive"></a> <h4>BackgroundService.__receive</h4> <b>__receive</b>(<i>lang</i>) + <p> Private method to receive the response from the clients. -</p><dl> +</p> +<dl> + <dt><i>lang</i></dt> <dd> language of the incomming connection (str) </dd> -</dl><a NAME="BackgroundService.__send" ID="BackgroundService.__send"></a> +</dl> +<a NAME="BackgroundService.__send" ID="BackgroundService.__send"></a> <h4>BackgroundService.__send</h4> <b>__send</b>(<i>fx, lang, fn, data</i>) + <p> Private method to send a job request to one of the clients. -</p><dl> +</p> +<dl> + <dt><i>fx</i></dt> <dd> remote function name to execute (str) -</dd><dt><i>lang</i></dt> +</dd> +<dt><i>lang</i></dt> <dd> language to connect to (str) -</dd><dt><i>fn</i></dt> +</dd> +<dt><i>fn</i></dt> <dd> filename for identification (str) -</dd><dt><i>data</i></dt> +</dd> +<dt><i>data</i></dt> <dd> function argument(s) (any basic datatype) </dd> -</dl><a NAME="BackgroundService.__startExternalClient" ID="BackgroundService.__startExternalClient"></a> +</dl> +<a NAME="BackgroundService.__startExternalClient" ID="BackgroundService.__startExternalClient"></a> <h4>BackgroundService.__startExternalClient</h4> <b>__startExternalClient</b>(<i>interpreter, port</i>) + <p> Private method to start the background client as external process. -</p><dl> +</p> +<dl> + <dt><i>interpreter</i></dt> <dd> path and name of the executable to start (string) -</dd><dt><i>port</i></dt> +</dd> +<dt><i>port</i></dt> <dd> socket port to which the interpreter should connect (int) </dd> -</dl><dl> +</dl> +<dl> <dt>Returns:</dt> <dd> the process object (QProcess or None) </dd> -</dl><a NAME="BackgroundService.enqueueRequest" ID="BackgroundService.enqueueRequest"></a> +</dl> +<a NAME="BackgroundService.enqueueRequest" ID="BackgroundService.enqueueRequest"></a> <h4>BackgroundService.enqueueRequest</h4> <b>enqueueRequest</b>(<i>fx, lang, fn, data</i>) + <p> Public method implementing a queued processing of incomming events. -</p><p> +</p> +<p> Dublicate service requests updates an older request to avoid overrun or starving of the services. -</p><dl> +</p> +<dl> + <dt><i>fx</i></dt> <dd> function name of the service (str) -</dd><dt><i>lang</i></dt> +</dd> +<dt><i>lang</i></dt> <dd> language to connect to (str) -</dd><dt><i>fn</i></dt> +</dd> +<dt><i>fn</i></dt> <dd> filename for identification (str) -</dd><dt><i>data</i></dt> +</dd> +<dt><i>data</i></dt> <dd> function argument(s) (any basic datatype(s)) </dd> -</dl><a NAME="BackgroundService.on_disconnectSocket" ID="BackgroundService.on_disconnectSocket"></a> +</dl> +<a NAME="BackgroundService.on_disconnectSocket" ID="BackgroundService.on_disconnectSocket"></a> <h4>BackgroundService.on_disconnectSocket</h4> <b>on_disconnectSocket</b>(<i>lang</i>) + <p> Private slot called when connection to a client is lost. -</p><dl> +</p> +<dl> + <dt><i>lang</i></dt> <dd> client language which connection is lost (str) </dd> -</dl><a NAME="BackgroundService.on_newConnection" ID="BackgroundService.on_newConnection"></a> +</dl> +<a NAME="BackgroundService.on_newConnection" ID="BackgroundService.on_newConnection"></a> <h4>BackgroundService.on_newConnection</h4> <b>on_newConnection</b>(<i></i>) + <p> Private slot for new incomming connections from the clients. -</p><a NAME="BackgroundService.preferencesOrProjectChanged" ID="BackgroundService.preferencesOrProjectChanged"></a> +</p> +<a NAME="BackgroundService.preferencesOrProjectChanged" ID="BackgroundService.preferencesOrProjectChanged"></a> <h4>BackgroundService.preferencesOrProjectChanged</h4> <b>preferencesOrProjectChanged</b>(<i></i>) + <p> Public slot to restart the built in languages. -</p><a NAME="BackgroundService.requestCancel" ID="BackgroundService.requestCancel"></a> +</p> +<a NAME="BackgroundService.requestCancel" ID="BackgroundService.requestCancel"></a> <h4>BackgroundService.requestCancel</h4> <b>requestCancel</b>(<i>fx, lang</i>) + <p> Public method to ask a batch job to terminate. -</p><dl> +</p> +<dl> + <dt><i>fx</i></dt> <dd> function name of the service (str) -</dd><dt><i>lang</i></dt> +</dd> +<dt><i>lang</i></dt> <dd> language to connect to (str) </dd> -</dl><a NAME="BackgroundService.restartService" ID="BackgroundService.restartService"></a> +</dl> +<a NAME="BackgroundService.restartService" ID="BackgroundService.restartService"></a> <h4>BackgroundService.restartService</h4> <b>restartService</b>(<i>language, forceKill=False</i>) + <p> Public method to restart a given lanuage. -</p><dl> +</p> +<dl> + <dt><i>language</i></dt> <dd> to restart (str) -</dd><dt><i>forceKill=</i></dt> +</dd> +<dt><i>forceKill=</i></dt> <dd> flag to kill a running task (bool) </dd> -</dl><a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a> +</dl> +<a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a> <h4>BackgroundService.serviceConnect</h4> <b>serviceConnect</b>(<i>fx, lang, modulepath, module, callback, onErrorCallback=None, onBatchDone=None</i>) + <p> Public method to announce a new service to the background service/client. -</p><dl> +</p> +<dl> + <dt><i>fx</i></dt> <dd> function name of the service (str) -</dd><dt><i>lang</i></dt> +</dd> +<dt><i>lang</i></dt> <dd> language of the new service (str) -</dd><dt><i>modulepath</i></dt> +</dd> +<dt><i>modulepath</i></dt> <dd> full path to the module (str) -</dd><dt><i>module</i></dt> +</dd> +<dt><i>module</i></dt> <dd> name to import (str) -</dd><dt><i>callback</i></dt> +</dd> +<dt><i>callback</i></dt> <dd> function called on service response (function) -</dd><dt><i>onErrorCallback</i></dt> +</dd> +<dt><i>onErrorCallback</i></dt> <dd> function called, if client isn't available (function) -</dd><dt><i>onBatchDone</i></dt> +</dd> +<dt><i>onBatchDone</i></dt> <dd> function called when a batch job is done (function) </dd> -</dl><a NAME="BackgroundService.serviceDisconnect" ID="BackgroundService.serviceDisconnect"></a> +</dl> +<a NAME="BackgroundService.serviceDisconnect" ID="BackgroundService.serviceDisconnect"></a> <h4>BackgroundService.serviceDisconnect</h4> <b>serviceDisconnect</b>(<i>fx, lang</i>) + <p> Public method to remove the service from the service list. -</p><dl> +</p> +<dl> + <dt><i>fx</i></dt> <dd> function name of the service (function) -</dd><dt><i>lang</i></dt> +</dd> +<dt><i>lang</i></dt> <dd> language of the service (str) </dd> -</dl><a NAME="BackgroundService.shutdown" ID="BackgroundService.shutdown"></a> +</dl> +<a NAME="BackgroundService.shutdown" ID="BackgroundService.shutdown"></a> <h4>BackgroundService.shutdown</h4> <b>shutdown</b>(<i></i>) + <p> Public method to cleanup the connections and processes when eric is shutting down.