mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
22 lines
551 B
C++
22 lines
551 B
C++
#include "TessesFramework/Http/CallbackServer.hpp"
|
|
|
|
namespace Tesses::Framework::Http
|
|
{
|
|
CallbackServer::CallbackServer(std::function<bool(ServerContext&)> cb) : CallbackServer(cb,[]()->void{})
|
|
{
|
|
|
|
}
|
|
CallbackServer::CallbackServer(std::function<bool(ServerContext&)> cb,std::function<void()> destroy)
|
|
{
|
|
this->cb = cb;
|
|
this->destroy=destroy;
|
|
}
|
|
bool CallbackServer::Handle(ServerContext& ctx)
|
|
{
|
|
return this->cb(ctx);
|
|
}
|
|
CallbackServer::~CallbackServer()
|
|
{
|
|
this->destroy();
|
|
}
|
|
} |