(self, timeout)
| 56 | return True |
| 57 | |
| 58 | def run_for_one(self, timeout): |
| 59 | listener = self.sockets[0] |
| 60 | while self.alive: |
| 61 | self.notify() |
| 62 | |
| 63 | # Accept a connection. If we get an error telling us |
| 64 | # that no connection is waiting we fall down to the |
| 65 | # select which is where we'll wait for a bit for new |
| 66 | # workers to come give us some love. |
| 67 | try: |
| 68 | self.accept(listener) |
| 69 | # Keep processing clients until no one is waiting. This |
| 70 | # prevents the need to select() for every client that we |
| 71 | # process. |
| 72 | continue |
| 73 | |
| 74 | except OSError as e: |
| 75 | if e.errno not in (errno.EAGAIN, errno.ECONNABORTED, |
| 76 | errno.EWOULDBLOCK): |
| 77 | raise |
| 78 | |
| 79 | if not self.is_parent_alive(): |
| 80 | return |
| 81 | |
| 82 | try: |
| 83 | self.wait(timeout) |
| 84 | except StopWaiting: |
| 85 | return |
| 86 | |
| 87 | def run_for_multiple(self, timeout): |
| 88 | while self.alive: |
no test coverage detected