| 45 | } |
| 46 | |
| 47 | void RemoteQueryExecutorReadContext::Task::run(AsyncCallback async_callback, SuspendCallback suspend_callback) |
| 48 | { |
| 49 | read_context.executor.sendQueryUnlocked(ClientInfo::QueryKind::SECONDARY_QUERY, async_callback); |
| 50 | read_context.is_query_sent = true; |
| 51 | |
| 52 | if (read_context.suspend_when_query_sent) |
| 53 | suspend_callback(); |
| 54 | |
| 55 | if (read_context.executor.needToSkipUnavailableShard()) |
| 56 | return; |
| 57 | |
| 58 | while (true) |
| 59 | { |
| 60 | read_context.has_read_packet_part = PacketPart::None; |
| 61 | |
| 62 | if (read_context.read_packet_type_separately) |
| 63 | { |
| 64 | read_context.packet.type = read_context.executor.getConnections().receivePacketTypeUnlocked(async_callback); |
| 65 | read_context.has_read_packet_part = PacketPart::Type; |
| 66 | suspend_callback(); |
| 67 | } |
| 68 | read_context.packet = read_context.executor.getConnections().receivePacketUnlocked(async_callback); |
| 69 | read_context.has_read_packet_part = PacketPart::Body; |
| 70 | suspend_callback(); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | void RemoteQueryExecutorReadContext::processAsyncEvent( |
| 75 | int fd, Poco::Timespan socket_timeout, AsyncEventTimeoutType type, const std::string & description, uint32_t events) |
no test coverage detected