#ifndef TILE_NET_INTERNAL_HTTP_ENGINE_H
#define TILE_NET_INTERNAL_HTTP_ENGINE_H

#pragma once

#include "tile/base/expected.h"
#include "tile/base/never_destroyed.h"
#include "tile/base/status.h"
#include "tile/net/internal/http_task.h"

#include <chrono>

namespace tile {
namespace internal {
class HttpEngine {
public:
    static HttpEngine *Instance();
    void StartTask(HttpTask task, std::function<void(std::expected<HttpTaskCompletion, Status>)>);

    static void Stop();
    static void Join();

private:
    friend class NeverDestroyedSingleton<HttpEngine>;
    HttpEngine();
};
}// namespace internal
}// namespace tile

#endif// TILE_NET_INTERNAL_HTTP_ENGINE_H
