Ejemplo n.º 1
0
void inputThread(BlockInputStreamPtr in, BlockOutputStreamPtr out, WriteBuffer & wb, std::mutex & mutex)
{
	while (Block block = in->read())
	{
		std::lock_guard<std::mutex> lock(mutex);

		out->write(block);
		wb.next();
	}
}
Ejemplo n.º 2
0
void Service::processQuery(const Poco::Net::HTMLForm & params, ReadBuffer & body, WriteBuffer & out)
{
	if (is_cancelled)
		throw Exception{"RemoteQueryExecutor service terminated", ErrorCodes::ABORTED};

	std::string query = params.get("query");

	bool flag = true;

	try
	{
		(void) executeQuery(query, context, true);
	}
	catch (...)
	{
		tryLogCurrentException(__PRETTY_FUNCTION__);
		flag = false;
	}

	writeBinary(flag, out);
	out.next();
}