Init
This commit is contained in:
28
Modules/Server/src/worker.hpp
Normal file
28
Modules/Server/src/worker.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Created by s-har on 25.05.2021.
|
||||
//
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <soci/session.h>
|
||||
|
||||
#include "tables.hpp"
|
||||
|
||||
class Worker
|
||||
{
|
||||
std::thread thread;
|
||||
soci::session& sql;
|
||||
|
||||
std::string output_path = "./downloads";
|
||||
public:
|
||||
explicit Worker(soci::session& sql);
|
||||
|
||||
[[noreturn]] void loop();
|
||||
|
||||
private:
|
||||
bool getTask(File& task);
|
||||
|
||||
bool download(File& task);
|
||||
};
|
||||
Reference in New Issue
Block a user