(self)
| 111 | self.server = xmlrpclib.Server("http://%s:%s" % (pydev_localhost.get_localhost(), port), encoding=encoding) |
| 112 | |
| 113 | def run(self): |
| 114 | while True: |
| 115 | kill_found = False |
| 116 | commands = [] |
| 117 | command = self.notifications_queue.get(block=True) |
| 118 | if isinstance(command, KillServer): |
| 119 | kill_found = True |
| 120 | else: |
| 121 | assert isinstance(command, ParallelNotification) |
| 122 | commands.append(command.to_tuple()) |
| 123 | |
| 124 | try: |
| 125 | while True: |
| 126 | command = self.notifications_queue.get(block=False) # No block to create a batch. |
| 127 | if isinstance(command, KillServer): |
| 128 | kill_found = True |
| 129 | else: |
| 130 | assert isinstance(command, ParallelNotification) |
| 131 | commands.append(command.to_tuple()) |
| 132 | except: |
| 133 | pass # That's OK, we're getting it until it becomes empty so that we notify multiple at once. |
| 134 | |
| 135 | if commands: |
| 136 | try: |
| 137 | self.server.notifyCommands(commands) |
| 138 | except: |
| 139 | traceback.print_exc() |
| 140 | |
| 141 | if kill_found: |
| 142 | self.finished = True |
| 143 | return |
| 144 | |
| 145 | |
| 146 | # ======================================================================================================================= |
no test coverage detected