2021-03-05 09:38:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/Context.h>
|
|
|
|
#include <Server/HTTP/HTTPRequestHandlerFactory.h>
|
2021-10-02 07:13:14 +00:00
|
|
|
#include <base/logger_useful.h>
|
2021-03-05 09:38:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class SharedLibraryHandler;
|
|
|
|
using SharedLibraryHandlerPtr = std::shared_ptr<SharedLibraryHandler>;
|
|
|
|
|
|
|
|
/// Factory for '/ping', '/' handlers.
|
2021-04-10 23:33:54 +00:00
|
|
|
class LibraryBridgeHandlerFactory : public HTTPRequestHandlerFactory, WithContext
|
2021-03-05 09:38:00 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
LibraryBridgeHandlerFactory(
|
|
|
|
const std::string & name_,
|
|
|
|
size_t keep_alive_timeout_,
|
2021-04-10 23:33:54 +00:00
|
|
|
ContextPtr context_)
|
|
|
|
: WithContext(context_)
|
|
|
|
, log(&Poco::Logger::get(name_))
|
2021-03-05 09:38:00 +00:00
|
|
|
, 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;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|