| 180 | |
| 181 | |
| 182 | class _BusyWaitDispatcher(object): |
| 183 | |
| 184 | max_write_latency = 0.001 |
| 185 | """ |
| 186 | Timeout pushed down to asyncore select/poll. Dictates the amount of time it will sleep before coming back to check |
| 187 | if anything is writable. |
| 188 | """ |
| 189 | |
| 190 | def notify_loop(self): |
| 191 | pass |
| 192 | |
| 193 | def loop(self, timeout): |
| 194 | if not _dispatcher_map: |
| 195 | time.sleep(0.005) |
| 196 | count = timeout // self.max_write_latency |
| 197 | asyncore.loop(timeout=self.max_write_latency, use_poll=True, map=_dispatcher_map, count=count) |
| 198 | |
| 199 | def validate(self): |
| 200 | pass |
| 201 | |
| 202 | def close(self): |
| 203 | pass |
| 204 | |
| 205 | |
| 206 | class AsyncoreLoop(object): |