5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.Utilities.BackgroundService</h1> |
9 <h1>eric7.Utilities.BackgroundService</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing a background service for the various checkers and other |
11 Module implementing a background service for the various checkers and other |
13 Python interpreter dependent functions. |
12 Python interpreter dependent functions. |
14 </p> |
13 </p> |
|
14 |
15 <h3>Global Attributes</h3> |
15 <h3>Global Attributes</h3> |
16 |
|
17 <table> |
16 <table> |
18 <tr><td>None</td></tr> |
17 <tr><td>None</td></tr> |
19 </table> |
18 </table> |
|
19 |
20 <h3>Classes</h3> |
20 <h3>Classes</h3> |
21 |
21 <table> |
22 <table> |
|
23 |
|
24 <tr> |
22 <tr> |
25 <td><a href="#BackgroundService">BackgroundService</a></td> |
23 <td><a href="#BackgroundService">BackgroundService</a></td> |
26 <td>Class implementing the main part of the background service.</td> |
24 <td>Class implementing the main part of the background service.</td> |
27 </tr> |
25 </tr> |
28 </table> |
26 </table> |
|
27 |
29 <h3>Functions</h3> |
28 <h3>Functions</h3> |
30 |
|
31 <table> |
29 <table> |
32 <tr><td>None</td></tr> |
30 <tr><td>None</td></tr> |
33 </table> |
31 </table> |
|
32 |
34 <hr /> |
33 <hr /> |
35 <hr /> |
34 <hr /> |
36 <a NAME="BackgroundService" ID="BackgroundService"></a> |
35 <a NAME="BackgroundService" ID="BackgroundService"></a> |
37 <h2>BackgroundService</h2> |
36 <h2>BackgroundService</h2> |
38 |
|
39 <p> |
37 <p> |
40 Class implementing the main part of the background service. |
38 Class implementing the main part of the background service. |
41 </p> |
39 </p> |
|
40 |
42 <h3>Signals</h3> |
41 <h3>Signals</h3> |
43 <dl> |
42 <dl> |
44 |
43 |
45 <dt>batchJobDone(function, language)</dt> |
44 <dt>batchJobDone(function, language)</dt> |
46 <dd> |
45 <dd> |
54 </dd> |
53 </dd> |
55 </dl> |
54 </dl> |
56 <h3>Derived from</h3> |
55 <h3>Derived from</h3> |
57 QTcpServer |
56 QTcpServer |
58 <h3>Class Attributes</h3> |
57 <h3>Class Attributes</h3> |
59 |
|
60 <table> |
58 <table> |
61 <tr><td>None</td></tr> |
59 <tr><td>None</td></tr> |
62 </table> |
60 </table> |
|
61 |
63 <h3>Class Methods</h3> |
62 <h3>Class Methods</h3> |
64 |
|
65 <table> |
63 <table> |
66 <tr><td>None</td></tr> |
64 <tr><td>None</td></tr> |
67 </table> |
65 </table> |
|
66 |
68 <h3>Methods</h3> |
67 <h3>Methods</h3> |
69 |
68 <table> |
70 <table> |
|
71 |
|
72 <tr> |
69 <tr> |
73 <td><a href="#BackgroundService.__init__">BackgroundService</a></td> |
70 <td><a href="#BackgroundService.__init__">BackgroundService</a></td> |
74 <td>Constructor</td> |
71 <td>Constructor</td> |
75 </tr> |
72 </tr> |
76 <tr> |
73 <tr> |
128 <tr> |
125 <tr> |
129 <td><a href="#BackgroundService.shutdown">shutdown</a></td> |
126 <td><a href="#BackgroundService.shutdown">shutdown</a></td> |
130 <td>Public method to cleanup the connections and processes when eric is shutting down.</td> |
127 <td>Public method to cleanup the connections and processes when eric is shutting down.</td> |
131 </tr> |
128 </tr> |
132 </table> |
129 </table> |
|
130 |
133 <h3>Static Methods</h3> |
131 <h3>Static Methods</h3> |
134 |
|
135 <table> |
132 <table> |
136 <tr><td>None</td></tr> |
133 <tr><td>None</td></tr> |
137 </table> |
134 </table> |
|
135 |
138 |
136 |
139 <a NAME="BackgroundService.__init__" ID="BackgroundService.__init__"></a> |
137 <a NAME="BackgroundService.__init__" ID="BackgroundService.__init__"></a> |
140 <h4>BackgroundService (Constructor)</h4> |
138 <h4>BackgroundService (Constructor)</h4> |
141 <b>BackgroundService</b>(<i>parent=None</i>) |
139 <b>BackgroundService</b>(<i>parent=None</i>) |
142 |
|
143 <p> |
140 <p> |
144 Constructor |
141 Constructor |
145 </p> |
142 </p> |
|
143 |
146 <dl> |
144 <dl> |
147 |
145 |
148 <dt><i>parent</i> (QObject)</dt> |
146 <dt><i>parent</i> (QObject)</dt> |
149 <dd> |
147 <dd> |
150 reference to the parent object |
148 reference to the parent object |
151 </dd> |
149 </dd> |
152 </dl> |
150 </dl> |
153 <a NAME="BackgroundService.__getPythonInterpreter" ID="BackgroundService.__getPythonInterpreter"></a> |
151 <a NAME="BackgroundService.__getPythonInterpreter" ID="BackgroundService.__getPythonInterpreter"></a> |
154 <h4>BackgroundService.__getPythonInterpreter</h4> |
152 <h4>BackgroundService.__getPythonInterpreter</h4> |
155 <b>__getPythonInterpreter</b>(<i></i>) |
153 <b>__getPythonInterpreter</b>(<i></i>) |
156 |
|
157 <p> |
154 <p> |
158 Private method to generate the path of the Python interpreter to be |
155 Private method to generate the path of the Python interpreter to be |
159 used to run the background client. |
156 used to run the background client. |
160 </p> |
157 </p> |
|
158 |
161 <dl> |
159 <dl> |
162 <dt>Return:</dt> |
160 <dt>Return:</dt> |
163 <dd> |
161 <dd> |
164 path of the Python interpreter |
162 path of the Python interpreter |
165 </dd> |
163 </dd> |
171 </dd> |
169 </dd> |
172 </dl> |
170 </dl> |
173 <a NAME="BackgroundService.__processQueue" ID="BackgroundService.__processQueue"></a> |
171 <a NAME="BackgroundService.__processQueue" ID="BackgroundService.__processQueue"></a> |
174 <h4>BackgroundService.__processQueue</h4> |
172 <h4>BackgroundService.__processQueue</h4> |
175 <b>__processQueue</b>(<i></i>) |
173 <b>__processQueue</b>(<i></i>) |
176 |
|
177 <p> |
174 <p> |
178 Private method to take the next service request and send it to the |
175 Private method to take the next service request and send it to the |
179 client. |
176 client. |
180 </p> |
177 </p> |
|
178 |
181 <a NAME="BackgroundService.__receive" ID="BackgroundService.__receive"></a> |
179 <a NAME="BackgroundService.__receive" ID="BackgroundService.__receive"></a> |
182 <h4>BackgroundService.__receive</h4> |
180 <h4>BackgroundService.__receive</h4> |
183 <b>__receive</b>(<i>lang</i>) |
181 <b>__receive</b>(<i>lang</i>) |
184 |
|
185 <p> |
182 <p> |
186 Private method to receive the response from the clients. |
183 Private method to receive the response from the clients. |
187 </p> |
184 </p> |
|
185 |
188 <dl> |
186 <dl> |
189 |
187 |
190 <dt><i>lang</i> (str)</dt> |
188 <dt><i>lang</i> (str)</dt> |
191 <dd> |
189 <dd> |
192 language of the incoming connection |
190 language of the incoming connection |
200 </dd> |
198 </dd> |
201 </dl> |
199 </dl> |
202 <a NAME="BackgroundService.__send" ID="BackgroundService.__send"></a> |
200 <a NAME="BackgroundService.__send" ID="BackgroundService.__send"></a> |
203 <h4>BackgroundService.__send</h4> |
201 <h4>BackgroundService.__send</h4> |
204 <b>__send</b>(<i>fx, lang, fn, data</i>) |
202 <b>__send</b>(<i>fx, lang, fn, data</i>) |
205 |
|
206 <p> |
203 <p> |
207 Private method to send a job request to one of the clients. |
204 Private method to send a job request to one of the clients. |
208 </p> |
205 </p> |
|
206 |
209 <dl> |
207 <dl> |
210 |
208 |
211 <dt><i>fx</i> (str)</dt> |
209 <dt><i>fx</i> (str)</dt> |
212 <dd> |
210 <dd> |
213 remote function name to execute |
211 remote function name to execute |
226 </dd> |
224 </dd> |
227 </dl> |
225 </dl> |
228 <a NAME="BackgroundService.__startExternalClient" ID="BackgroundService.__startExternalClient"></a> |
226 <a NAME="BackgroundService.__startExternalClient" ID="BackgroundService.__startExternalClient"></a> |
229 <h4>BackgroundService.__startExternalClient</h4> |
227 <h4>BackgroundService.__startExternalClient</h4> |
230 <b>__startExternalClient</b>(<i>interpreter, port</i>) |
228 <b>__startExternalClient</b>(<i>interpreter, port</i>) |
231 |
|
232 <p> |
229 <p> |
233 Private method to start the background client as external process. |
230 Private method to start the background client as external process. |
234 </p> |
231 </p> |
|
232 |
235 <dl> |
233 <dl> |
236 |
234 |
237 <dt><i>interpreter</i> (str)</dt> |
235 <dt><i>interpreter</i> (str)</dt> |
238 <dd> |
236 <dd> |
239 path and name of the executable to start |
237 path and name of the executable to start |
256 </dd> |
254 </dd> |
257 </dl> |
255 </dl> |
258 <a NAME="BackgroundService.enqueueRequest" ID="BackgroundService.enqueueRequest"></a> |
256 <a NAME="BackgroundService.enqueueRequest" ID="BackgroundService.enqueueRequest"></a> |
259 <h4>BackgroundService.enqueueRequest</h4> |
257 <h4>BackgroundService.enqueueRequest</h4> |
260 <b>enqueueRequest</b>(<i>fx, lang, fn, data</i>) |
258 <b>enqueueRequest</b>(<i>fx, lang, fn, data</i>) |
261 |
|
262 <p> |
259 <p> |
263 Public method implementing a queued processing of incoming events. |
260 Public method implementing a queued processing of incoming events. |
264 </p> |
261 </p> |
265 <p> |
262 <p> |
266 Duplicate service requests update an older request to avoid overrun or |
263 Duplicate service requests update an older request to avoid overrun or |
267 starving of the services. |
264 starving of the services. |
268 </p> |
265 </p> |
|
266 |
269 <dl> |
267 <dl> |
270 |
268 |
271 <dt><i>fx</i> (str)</dt> |
269 <dt><i>fx</i> (str)</dt> |
272 <dd> |
270 <dd> |
273 function name of the service |
271 function name of the service |
286 </dd> |
284 </dd> |
287 </dl> |
285 </dl> |
288 <a NAME="BackgroundService.on_disconnectSocket" ID="BackgroundService.on_disconnectSocket"></a> |
286 <a NAME="BackgroundService.on_disconnectSocket" ID="BackgroundService.on_disconnectSocket"></a> |
289 <h4>BackgroundService.on_disconnectSocket</h4> |
287 <h4>BackgroundService.on_disconnectSocket</h4> |
290 <b>on_disconnectSocket</b>(<i>lang</i>) |
288 <b>on_disconnectSocket</b>(<i>lang</i>) |
291 |
|
292 <p> |
289 <p> |
293 Private slot called when connection to a client is lost. |
290 Private slot called when connection to a client is lost. |
294 </p> |
291 </p> |
|
292 |
295 <dl> |
293 <dl> |
296 |
294 |
297 <dt><i>lang</i> (str)</dt> |
295 <dt><i>lang</i> (str)</dt> |
298 <dd> |
296 <dd> |
299 client language which connection is lost |
297 client language which connection is lost |
300 </dd> |
298 </dd> |
301 </dl> |
299 </dl> |
302 <a NAME="BackgroundService.on_newConnection" ID="BackgroundService.on_newConnection"></a> |
300 <a NAME="BackgroundService.on_newConnection" ID="BackgroundService.on_newConnection"></a> |
303 <h4>BackgroundService.on_newConnection</h4> |
301 <h4>BackgroundService.on_newConnection</h4> |
304 <b>on_newConnection</b>(<i></i>) |
302 <b>on_newConnection</b>(<i></i>) |
305 |
|
306 <p> |
303 <p> |
307 Private slot for new incoming connections from the clients. |
304 Private slot for new incoming connections from the clients. |
308 </p> |
305 </p> |
|
306 |
309 <a NAME="BackgroundService.preferencesOrProjectChanged" ID="BackgroundService.preferencesOrProjectChanged"></a> |
307 <a NAME="BackgroundService.preferencesOrProjectChanged" ID="BackgroundService.preferencesOrProjectChanged"></a> |
310 <h4>BackgroundService.preferencesOrProjectChanged</h4> |
308 <h4>BackgroundService.preferencesOrProjectChanged</h4> |
311 <b>preferencesOrProjectChanged</b>(<i></i>) |
309 <b>preferencesOrProjectChanged</b>(<i></i>) |
312 |
|
313 <p> |
310 <p> |
314 Public slot to restart the built in languages. |
311 Public slot to restart the built in languages. |
315 </p> |
312 </p> |
|
313 |
316 <a NAME="BackgroundService.requestCancel" ID="BackgroundService.requestCancel"></a> |
314 <a NAME="BackgroundService.requestCancel" ID="BackgroundService.requestCancel"></a> |
317 <h4>BackgroundService.requestCancel</h4> |
315 <h4>BackgroundService.requestCancel</h4> |
318 <b>requestCancel</b>(<i>fx, lang</i>) |
316 <b>requestCancel</b>(<i>fx, lang</i>) |
319 |
|
320 <p> |
317 <p> |
321 Public method to ask a batch job to terminate. |
318 Public method to ask a batch job to terminate. |
322 </p> |
319 </p> |
|
320 |
323 <dl> |
321 <dl> |
324 |
322 |
325 <dt><i>fx</i> (str)</dt> |
323 <dt><i>fx</i> (str)</dt> |
326 <dd> |
324 <dd> |
327 function name of the service |
325 function name of the service |
332 </dd> |
330 </dd> |
333 </dl> |
331 </dl> |
334 <a NAME="BackgroundService.restartService" ID="BackgroundService.restartService"></a> |
332 <a NAME="BackgroundService.restartService" ID="BackgroundService.restartService"></a> |
335 <h4>BackgroundService.restartService</h4> |
333 <h4>BackgroundService.restartService</h4> |
336 <b>restartService</b>(<i>language, forceKill=False</i>) |
334 <b>restartService</b>(<i>language, forceKill=False</i>) |
337 |
|
338 <p> |
335 <p> |
339 Public method to restart a given language. |
336 Public method to restart a given language. |
340 </p> |
337 </p> |
|
338 |
341 <dl> |
339 <dl> |
342 |
340 |
343 <dt><i>language</i> (str)</dt> |
341 <dt><i>language</i> (str)</dt> |
344 <dd> |
342 <dd> |
345 to restart |
343 to restart |
350 </dd> |
348 </dd> |
351 </dl> |
349 </dl> |
352 <a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a> |
350 <a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a> |
353 <h4>BackgroundService.serviceConnect</h4> |
351 <h4>BackgroundService.serviceConnect</h4> |
354 <b>serviceConnect</b>(<i>fx, lang, modulepath, module, callback, onErrorCallback=None, onBatchDone=None, </i>) |
352 <b>serviceConnect</b>(<i>fx, lang, modulepath, module, callback, onErrorCallback=None, onBatchDone=None, </i>) |
355 |
|
356 <p> |
353 <p> |
357 Public method to announce a new service to the background |
354 Public method to announce a new service to the background |
358 service/client. |
355 service/client. |
359 </p> |
356 </p> |
|
357 |
360 <dl> |
358 <dl> |
361 |
359 |
362 <dt><i>fx</i> (str)</dt> |
360 <dt><i>fx</i> (str)</dt> |
363 <dd> |
361 <dd> |
364 function name of the service |
362 function name of the service |
389 </dd> |
387 </dd> |
390 </dl> |
388 </dl> |
391 <a NAME="BackgroundService.serviceDisconnect" ID="BackgroundService.serviceDisconnect"></a> |
389 <a NAME="BackgroundService.serviceDisconnect" ID="BackgroundService.serviceDisconnect"></a> |
392 <h4>BackgroundService.serviceDisconnect</h4> |
390 <h4>BackgroundService.serviceDisconnect</h4> |
393 <b>serviceDisconnect</b>(<i>fx, lang</i>) |
391 <b>serviceDisconnect</b>(<i>fx, lang</i>) |
394 |
|
395 <p> |
392 <p> |
396 Public method to remove the service from the service list. |
393 Public method to remove the service from the service list. |
397 </p> |
394 </p> |
|
395 |
398 <dl> |
396 <dl> |
399 |
397 |
400 <dt><i>fx</i> (function)</dt> |
398 <dt><i>fx</i> (function)</dt> |
401 <dd> |
399 <dd> |
402 function name of the service |
400 function name of the service |
407 </dd> |
405 </dd> |
408 </dl> |
406 </dl> |
409 <a NAME="BackgroundService.shutdown" ID="BackgroundService.shutdown"></a> |
407 <a NAME="BackgroundService.shutdown" ID="BackgroundService.shutdown"></a> |
410 <h4>BackgroundService.shutdown</h4> |
408 <h4>BackgroundService.shutdown</h4> |
411 <b>shutdown</b>(<i></i>) |
409 <b>shutdown</b>(<i></i>) |
412 |
|
413 <p> |
410 <p> |
414 Public method to cleanup the connections and processes when eric is |
411 Public method to cleanup the connections and processes when eric is |
415 shutting down. |
412 shutting down. |
416 </p> |
413 </p> |
|
414 |
417 <div align="right"><a href="#top">Up</a></div> |
415 <div align="right"><a href="#top">Up</a></div> |
418 <hr /> |
416 <hr /> |
419 </body></html> |
417 </body></html> |