Documentation/Source/eric5.Utilities.BackgroundService.html

branch
Py2 comp.
changeset 3456
96232974dcdb
parent 3209
c5432abceb25
child 3515
1b8381afe38f
equal deleted inserted replaced
3178:f25fc1364c88 3456:96232974dcdb
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric5.Utilities.BackgroundService</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric5.Utilities.BackgroundService</h1>
23 <p>
24 Module implementing a background service for the various checkers and other
25 python interpreter dependent functions.
26 </p>
27 <h3>Global Attributes</h3>
28 <table>
29 <tr><td>None</td></tr>
30 </table>
31 <h3>Classes</h3>
32 <table>
33 <tr>
34 <td><a href="#BackgroundService">BackgroundService</a></td>
35 <td>Class implementing the main part of the background service.</td>
36 </tr>
37 </table>
38 <h3>Functions</h3>
39 <table>
40 <tr><td>None</td></tr>
41 </table>
42 <hr /><hr />
43 <a NAME="BackgroundService" ID="BackgroundService"></a>
44 <h2>BackgroundService</h2>
45 <p>
46 Class implementing the main part of the background service.
47 </p>
48 <h3>Derived from</h3>
49 QTcpServer
50 <h3>Class Attributes</h3>
51 <table>
52 <tr><td>None</td></tr>
53 </table>
54 <h3>Class Methods</h3>
55 <table>
56 <tr><td>None</td></tr>
57 </table>
58 <h3>Methods</h3>
59 <table>
60 <tr>
61 <td><a href="#BackgroundService.__init__">BackgroundService</a></td>
62 <td>Constructor of the BackgroundService class.</td>
63 </tr><tr>
64 <td><a href="#BackgroundService.__processQueue">__processQueue</a></td>
65 <td>Private method to take the next service request and send it to the client.</td>
66 </tr><tr>
67 <td><a href="#BackgroundService.__receive">__receive</a></td>
68 <td>Private method to receive the response from the clients.</td>
69 </tr><tr>
70 <td><a href="#BackgroundService.__send">__send</a></td>
71 <td>Private method to send a job request to one of the clients.</td>
72 </tr><tr>
73 <td><a href="#BackgroundService.__startExternalClient">__startExternalClient</a></td>
74 <td>Private method to start the background client as external process.</td>
75 </tr><tr>
76 <td><a href="#BackgroundService.__startInternalClient">__startInternalClient</a></td>
77 <td>Private method to start the background client as internal thread.</td>
78 </tr><tr>
79 <td><a href="#BackgroundService.enqueueRequest">enqueueRequest</a></td>
80 <td>Implement a queued processing of incomming events.</td>
81 </tr><tr>
82 <td><a href="#BackgroundService.on_disconnectSocket">on_disconnectSocket</a></td>
83 <td>Slot when connection to a client is lost.</td>
84 </tr><tr>
85 <td><a href="#BackgroundService.on_newConnection">on_newConnection</a></td>
86 <td>Slot for new incomming connections from the clients.</td>
87 </tr><tr>
88 <td><a href="#BackgroundService.serviceConnect">serviceConnect</a></td>
89 <td>Announce a new service to the background service/ client.</td>
90 </tr><tr>
91 <td><a href="#BackgroundService.serviceDisconnect">serviceDisconnect</a></td>
92 <td>Remove the service from the service list.</td>
93 </tr><tr>
94 <td><a href="#BackgroundService.shutdown">shutdown</a></td>
95 <td>Cleanup the connections and processes when Eric is shuting down.</td>
96 </tr>
97 </table>
98 <h3>Static Methods</h3>
99 <table>
100 <tr><td>None</td></tr>
101 </table>
102 <a NAME="BackgroundService.__init__" ID="BackgroundService.__init__"></a>
103 <h4>BackgroundService (Constructor)</h4>
104 <b>BackgroundService</b>(<i></i>)
105 <p>
106 Constructor of the BackgroundService class.
107 </p><a NAME="BackgroundService.__processQueue" ID="BackgroundService.__processQueue"></a>
108 <h4>BackgroundService.__processQueue</h4>
109 <b>__processQueue</b>(<i></i>)
110 <p>
111 Private method to take the next service request and send it to the
112 client.
113 </p><a NAME="BackgroundService.__receive" ID="BackgroundService.__receive"></a>
114 <h4>BackgroundService.__receive</h4>
115 <b>__receive</b>(<i>lang</i>)
116 <p>
117 Private method to receive the response from the clients.
118 </p><dl>
119 <dt><i>lang</i></dt>
120 <dd>
121 language of the incomming connection (str)
122 </dd>
123 </dl><a NAME="BackgroundService.__send" ID="BackgroundService.__send"></a>
124 <h4>BackgroundService.__send</h4>
125 <b>__send</b>(<i>fx, lang, fn, data</i>)
126 <p>
127 Private method to send a job request to one of the clients.
128 </p><dl>
129 <dt><i>fx</i></dt>
130 <dd>
131 remote function name to execute (str)
132 </dd><dt><i>lang</i></dt>
133 <dd>
134 language to connect to (str)
135 </dd><dt><i>fn</i></dt>
136 <dd>
137 filename for identification (str)
138 </dd><dt><i>data</i></dt>
139 <dd>
140 function argument(s) (any basic datatype)
141 </dd>
142 </dl><a NAME="BackgroundService.__startExternalClient" ID="BackgroundService.__startExternalClient"></a>
143 <h4>BackgroundService.__startExternalClient</h4>
144 <b>__startExternalClient</b>(<i>interpreter, port</i>)
145 <p>
146 Private method to start the background client as external process.
147 </p><dl>
148 <dt><i>interpreter</i></dt>
149 <dd>
150 path and name of the executable to start (string)
151 </dd><dt><i>port</i></dt>
152 <dd>
153 socket port to which the interpreter should connect (int)
154 </dd>
155 </dl><dl>
156 <dt>Returns:</dt>
157 <dd>
158 the process object (QProcess or None)
159 </dd>
160 </dl><a NAME="BackgroundService.__startInternalClient" ID="BackgroundService.__startInternalClient"></a>
161 <h4>BackgroundService.__startInternalClient</h4>
162 <b>__startInternalClient</b>(<i>port</i>)
163 <p>
164 Private method to start the background client as internal thread.
165 </p><dl>
166 <dt><i>port</i></dt>
167 <dd>
168 socket port to which the interpreter should connect (int)
169 </dd>
170 </dl><dl>
171 <dt>Returns:</dt>
172 <dd>
173 the thread object (Thread) or None
174 </dd>
175 </dl><a NAME="BackgroundService.enqueueRequest" ID="BackgroundService.enqueueRequest"></a>
176 <h4>BackgroundService.enqueueRequest</h4>
177 <b>enqueueRequest</b>(<i>fx, lang, fn, data</i>)
178 <p>
179 Implement a queued processing of incomming events.
180 </p><p>
181 Dublicate service requests updates an older request to avoid overrun or
182 starving of the services.
183 </p><dl>
184 <dt><i>fx</i></dt>
185 <dd>
186 function name of the service (str)
187 </dd><dt><i>lang</i></dt>
188 <dd>
189 language to connect to (str)
190 </dd><dt><i>fn</i></dt>
191 <dd>
192 filename for identification (str)
193 </dd><dt><i>data</i></dt>
194 <dd>
195 function argument(s) (any basic datatype(s))
196 </dd>
197 </dl><a NAME="BackgroundService.on_disconnectSocket" ID="BackgroundService.on_disconnectSocket"></a>
198 <h4>BackgroundService.on_disconnectSocket</h4>
199 <b>on_disconnectSocket</b>(<i>lang</i>)
200 <p>
201 Slot when connection to a client is lost.
202 </p><dl>
203 <dt><i>lang</i></dt>
204 <dd>
205 client language which connection is lost (str)
206 </dd>
207 </dl><a NAME="BackgroundService.on_newConnection" ID="BackgroundService.on_newConnection"></a>
208 <h4>BackgroundService.on_newConnection</h4>
209 <b>on_newConnection</b>(<i></i>)
210 <p>
211 Slot for new incomming connections from the clients.
212 </p><a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a>
213 <h4>BackgroundService.serviceConnect</h4>
214 <b>serviceConnect</b>(<i>fx, lang, modulepath, module, callback, onErrorCallback=None</i>)
215 <p>
216 Announce a new service to the background service/ client.
217 </p><dl>
218 <dt><i>fx</i></dt>
219 <dd>
220 function name of the service (str)
221 </dd><dt><i>lang</i></dt>
222 <dd>
223 language of the new service (str)
224 </dd><dt><i>modulepath</i></dt>
225 <dd>
226 full path to the module (str)
227 </dd><dt><i>module</i></dt>
228 <dd>
229 name to import (str)
230 </dd><dt><i>callback</i></dt>
231 <dd>
232 function on service response (function)
233 </dd><dt><i>onErrorCallback</i></dt>
234 <dd>
235 function if client isn't available (function)
236 </dd>
237 </dl><a NAME="BackgroundService.serviceDisconnect" ID="BackgroundService.serviceDisconnect"></a>
238 <h4>BackgroundService.serviceDisconnect</h4>
239 <b>serviceDisconnect</b>(<i>fx, lang</i>)
240 <p>
241 Remove the service from the service list.
242 </p><dl>
243 <dt><i>fx</i></dt>
244 <dd>
245 function name of the service (function)
246 </dd><dt><i>lang</i></dt>
247 <dd>
248 language of the service (str)
249 </dd>
250 </dl><a NAME="BackgroundService.shutdown" ID="BackgroundService.shutdown"></a>
251 <h4>BackgroundService.shutdown</h4>
252 <b>shutdown</b>(<i></i>)
253 <p>
254 Cleanup the connections and processes when Eric is shuting down.
255 </p>
256 <div align="right"><a href="#top">Up</a></div>
257 <hr />
258 </body></html>

eric ide

mercurial