1
0
forked from blue/pica
pica/handler/poll.h

36 lines
644 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 (std::weak_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;
};
}