WIP. Using WIOService to handle Services

This commit is contained in:
emeric
2014-08-05 13:11:31 +02:00
parent f26e6cad7c
commit 9fdc9f41dd
12 changed files with 148 additions and 65 deletions
+18 -2
View File
@@ -1,6 +1,8 @@
#ifndef DB_UPDATER_UPDATER_HPP
#define DB_UPDATER_UPDATER_HPP
#include <boost/asio/deadline_timer.hpp>
#include <Wt/WIOService>
#include "metadata/MetaData.hpp"
#include "database/DatabaseHandler.hpp"
@@ -15,8 +17,9 @@ class Updater
public:
Updater(boost::filesystem::path db, MetaData::Parser& parser);
// Update database
void process();
void start();
void stop();
private:
@@ -36,6 +39,14 @@ class Updater
Stats videoStats;
};
// Job handling
void processNextJob();
void scheduleScan(boost::posix_time::time_duration duration);
void scheduleScan(boost::posix_time::ptime time);
// Update database
void process(boost::system::error_code ec);
// Video
void refreshVideoDirectory( const boost::filesystem::path& directory );
void processVideoFile( const boost::filesystem::path& file);
@@ -47,6 +58,11 @@ class Updater
Database::Path::pointer getAddPath(const boost::filesystem::path& path);
bool _running;
Wt::WIOService _ioService;
boost::asio::deadline_timer _scheduleTimer;
Database::Handler _db;
MetaData::Parser& _metadataParser;