1
0
forked from blue/pica
pica/handler/poll.h
2024-01-22 15:21:55 -03:00

36 lines
653 B
C++

//SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
//SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <memory>
#include "handler.h"
#include "request/request.h"
#include "response/response.h"
class Server;
namespace Handler {
class Poll : public Handler {
public:
Poll (const std::shared_ptr<Server>& server);
void handle (Request& request) override;
enum class Result {
success,
tokenProblem,
replace,
timeout,
unknownError
};
static void error (Request& request, Result result, Response::Status status);
private:
std::weak_ptr<Server> server;
};
}