Documentation/Source/eric5.Utilities.BackgroundService.html

Sun, 18 May 2014 14:13:09 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 18 May 2014 14:13:09 +0200
changeset 3591
2f2a4a76dd22
parent 3579
eccd12461319
permissions
-rw-r--r--

Corrected a bunch of source docu issues.

<!DOCTYPE html>
<html><head>
<title>eric5.Utilities.BackgroundService</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric5.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 />
<a NAME="BackgroundService" ID="BackgroundService"></a>
<h2>BackgroundService</h2>
<p>
    Class implementing the main part of the background service.
</p>
<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>
<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>
<td><a href="#BackgroundService.__receive">__receive</a></td>
<td>Private method to receive the response from the clients.</td>
</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>
<td><a href="#BackgroundService.__startExternalClient">__startExternalClient</a></td>
<td>Private method to start the background client as external process.</td>
</tr><tr>
<td><a href="#BackgroundService.enqueueRequest">enqueueRequest</a></td>
<td>Public method implementing a queued processing of incomming events.</td>
</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>
<td><a href="#BackgroundService.on_newConnection">on_newConnection</a></td>
<td>Private slot for new incomming connections from the clients.</td>
</tr><tr>
<td><a href="#BackgroundService.preferencesOrProjectChanged">preferencesOrProjectChanged</a></td>
<td>Public slot to restart the built in languages.</td>
</tr><tr>
<td><a href="#BackgroundService.restartService">restartService</a></td>
<td>Public method to restart a given lanuage.</td>
</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>
<td><a href="#BackgroundService.serviceDisconnect">serviceDisconnect</a></td>
<td>Public method to remove the service from the service list.</td>
</tr><tr>
<td><a href="#BackgroundService.shutdown">shutdown</a></td>
<td>Public method to cleanup the connections and processes when eric is shuting 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>
<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>
<h4>BackgroundService.__receive</h4>
<b>__receive</b>(<i>lang</i>)
<p>
        Private method to receive the response from the clients.
</p><dl>
<dt><i>lang</i></dt>
<dd>
language of the incomming connection (str)
</dd>
</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>
<dt><i>fx</i></dt>
<dd>
remote function name to execute (str)
</dd><dt><i>lang</i></dt>
<dd>
language to connect to (str)
</dd><dt><i>fn</i></dt>
<dd>
filename for identification (str)
</dd><dt><i>data</i></dt>
<dd>
function argument(s) (any basic datatype)
</dd>
</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>
<dt><i>interpreter</i></dt>
<dd>
path and name of the executable to start (string)
</dd><dt><i>port</i></dt>
<dd>
socket port to which the interpreter should connect (int)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
the process object (QProcess or None)
</dd>
</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>
        Dublicate service requests updates an older request to avoid overrun or
        starving of the services.
</p><dl>
<dt><i>fx</i></dt>
<dd>
function name of the service (str)
</dd><dt><i>lang</i></dt>
<dd>
language to connect to (str)
</dd><dt><i>fn</i></dt>
<dd>
filename for identification (str)
</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>
<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>
<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>
<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>
<h4>BackgroundService.preferencesOrProjectChanged</h4>
<b>preferencesOrProjectChanged</b>(<i></i>)
<p>
        Public slot to restart the built in languages.
</p><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>
<dt><i>language</i></dt>
<dd>
to restart (str)
</dd><dt><i>forceKill=</i></dt>
<dd>
flag to kill a running task (bool)
</dd>
</dl><a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a>
<h4>BackgroundService.serviceConnect</h4>
<b>serviceConnect</b>(<i>fx, lang, modulepath, module, callback, onErrorCallback=None</i>)
<p>
        Public method to announce a new service to the background
        service/client.
</p><dl>
<dt><i>fx</i></dt>
<dd>
function name of the service (str)
</dd><dt><i>lang</i></dt>
<dd>
language of the new service (str)
</dd><dt><i>modulepath</i></dt>
<dd>
full path to the module (str)
</dd><dt><i>module</i></dt>
<dd>
name to import (str)
</dd><dt><i>callback</i></dt>
<dd>
function on service response (function)
</dd><dt><i>onErrorCallback</i></dt>
<dd>
function if client isn't available (function)
</dd>
</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>
<dt><i>fx</i></dt>
<dd>
function name of the service (function)
</dd><dt><i>lang</i></dt>
<dd>
language of the service (str)
</dd>
</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
        shuting down.
</p>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial