mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-06 07:32:27 +00:00
495c6e03aa
* Replace all Context references with std::weak_ptr * Fix shared context captured by value * Fix build * Fix Context with named sessions * Fix copy context * Fix gcc build * Merge with master and fix build * Fix gcc-9 build
38 lines
884 B
C++
38 lines
884 B
C++
#pragma once
|
|
|
|
#include <Interpreters/Context.h>
|
|
#include <Server/HTTP/HTTPRequestHandlerFactory.h>
|
|
#include <common/logger_useful.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class SharedLibraryHandler;
|
|
using SharedLibraryHandlerPtr = std::shared_ptr<SharedLibraryHandler>;
|
|
|
|
/// Factory for '/ping', '/' handlers.
|
|
class LibraryBridgeHandlerFactory : public HTTPRequestHandlerFactory, WithContext
|
|
{
|
|
public:
|
|
LibraryBridgeHandlerFactory(
|
|
const std::string & name_,
|
|
size_t keep_alive_timeout_,
|
|
ContextPtr context_)
|
|
: WithContext(context_)
|
|
, log(&Poco::Logger::get(name_))
|
|
, name(name_)
|
|
, keep_alive_timeout(keep_alive_timeout_)
|
|
{
|
|
}
|
|
|
|
std::unique_ptr<HTTPRequestHandler> createRequestHandler(const HTTPServerRequest & request) override;
|
|
|
|
private:
|
|
Poco::Logger * log;
|
|
std::string name;
|
|
size_t keep_alive_timeout;
|
|
};
|
|
|
|
}
|