Perform one iteration of the blocking event loop.
()
| 178 | obj.on_ready() |
| 179 | |
| 180 | def _loop_cycle(): |
| 181 | """ |
| 182 | Perform one iteration of the blocking event loop. |
| 183 | """ |
| 184 | if heartbeat_error[0] is not None: |
| 185 | raise heartbeat_error[0] |
| 186 | if dispatcher_heartbeat_error[0] is not None: |
| 187 | raise dispatcher_heartbeat_error[0] |
| 188 | if qos.prev != qos.value: |
| 189 | qos.update() |
| 190 | try: |
| 191 | perform_pending_operations() |
| 192 | connection.drain_events(timeout=2.0) |
| 193 | except socket.timeout: |
| 194 | pass |
| 195 | except OSError: |
| 196 | if blueprint.state == RUN: |
| 197 | raise |
| 198 | # drain this connection so broker heartbeats are consumed. |
| 199 | if is_green and obj.amqheartbeat and obj.event_dispatcher: |
| 200 | connection_ = obj.event_dispatcher.connection |
| 201 | if connection_ and connection_.supports_heartbeats: |
| 202 | try: |
| 203 | _quick_drain(obj.event_dispatcher.connection) |
| 204 | except OSError: |
| 205 | if blueprint.state == RUN: |
| 206 | raise |
| 207 | |
| 208 | try: |
| 209 | while blueprint.state == RUN and obj.connection: |
no test coverage detected