diff -r 5af61402d74d -r c5432abceb25 Documentation/Source/eric5.Utilities.BackgroundService.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Utilities.BackgroundService.html Wed Jan 15 22:55:52 2014 +0100 @@ -0,0 +1,259 @@ +<!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.__postResult">__postResult</a></td> +<td>Private method to emit the correspondig signal for the returned function.</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.__startInternalClient">__startInternalClient</a></td> +<td>Private method to start the background client as internal thread.</td> +</tr><tr> +<td><a href="#BackgroundService.enqueueRequest">enqueueRequest</a></td> +<td>Implement a queued processing of incomming events.</td> +</tr><tr> +<td><a href="#BackgroundService.on_newConnection">on_newConnection</a></td> +<td>Slot for new incomming connections from the clients.</td> +</tr><tr> +<td><a href="#BackgroundService.serviceConnect">serviceConnect</a></td> +<td>Announce a new service to the background service/ client.</td> +</tr><tr> +<td><a href="#BackgroundService.serviceDisconnect">serviceDisconnect</a></td> +<td>Remove the service from the service list.</td> +</tr><tr> +<td><a href="#BackgroundService.shutdown">shutdown</a></td> +<td>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.__postResult" ID="BackgroundService.__postResult"></a> +<h4>BackgroundService.__postResult</h4> +<b>__postResult</b>(<i>fx, fn, data</i>) +<p> + Private method to emit the correspondig signal for the returned + function. +</p><dl> +<dt><i>fx</i></dt> +<dd> +remote function name to execute (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.__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>channel</i>) +<p> + Private method to receive the response from the clients. +</p><dl> +<dt><i>channel</i></dt> +<dd> +of the incomming connection (int: 0 or 1) +</dd> +</dl><a NAME="BackgroundService.__send" ID="BackgroundService.__send"></a> +<h4>BackgroundService.__send</h4> +<b>__send</b>(<i>fx, fn, pyVer, 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>fn</i></dt> +<dd> +filename for identification (str) +</dd><dt><i>pyVer</i></dt> +<dd> +version for the required interpreter (int) +</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.__startInternalClient" ID="BackgroundService.__startInternalClient"></a> +<h4>BackgroundService.__startInternalClient</h4> +<b>__startInternalClient</b>(<i>port</i>) +<p> + Private method to start the background client as internal thread. +</p><dl> +<dt><i>port</i></dt> +<dd> +socket port to which the interpreter should connect (int) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +the thread object (Thread) or None +</dd> +</dl><a NAME="BackgroundService.enqueueRequest" ID="BackgroundService.enqueueRequest"></a> +<h4>BackgroundService.enqueueRequest</h4> +<b>enqueueRequest</b>(<i>fx, fn, pyVer, data</i>) +<p> + Implement a queued processing of incomming events. +</p><p> + Dublicate file checks update an older request to avoid overrun or + starving of the check. +</p><dl> +<dt><i>fx</i></dt> +<dd> +function name of the service (str) +</dd><dt><i>fn</i></dt> +<dd> +filename for identification (str) +</dd><dt><i>pyVer</i></dt> +<dd> +version for the required interpreter (int) +</dd><dt><i>data</i></dt> +<dd> +function argument(s) (any basic datatype) +</dd> +</dl><a NAME="BackgroundService.on_newConnection" ID="BackgroundService.on_newConnection"></a> +<h4>BackgroundService.on_newConnection</h4> +<b>on_newConnection</b>(<i></i>) +<p> + Slot for new incomming connections from the clients. +</p><a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a> +<h4>BackgroundService.serviceConnect</h4> +<b>serviceConnect</b>(<i>fx, modulepath, module, callback, onErrorCallback=None</i>) +<p> + 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>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</i>) +<p> + Remove the service from the service list. +</p><dl> +<dt><i>fx</i></dt> +<dd> +function name of the service +</dd> +</dl><a NAME="BackgroundService.shutdown" ID="BackgroundService.shutdown"></a> +<h4>BackgroundService.shutdown</h4> +<b>shutdown</b>(<i></i>) +<p> + Cleanup the connections and processes when Eric is shuting down. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file