Leosac  0.8.0
Open Source Access Control
Leosac::Tasks::SyncConfig Class Reference

Sync the configuration using the configuration fetched from the master server. More...

#include <SyncConfig.hpp>

+ Inheritance diagram for Leosac::Tasks::SyncConfig:
+ Collaboration diagram for Leosac::Tasks::SyncConfig:

Public Member Functions

 SyncConfig (Kernel &kref, FetchRemoteConfigPtr fetch_task, bool sync_general_config, bool autocommit)
 
- Public Member Functions inherited from Leosac::Tasks::Task
 Task ()
 
virtual ~Task ()
 
 Task (const Task &)=delete
 
 Task (Task &&)=delete
 
Taskoperator= (const Task &)=delete
 
Taskoperator= (Task &&)=delete
 
bool is_complete () const
 Has the tasks completed its execution. More...
 
void wait ()
 Instead of spinlocking over is_complete() one can call wait() to hum... More...
 
void run ()
 
bool succeed () const
 
std::exception_ptr get_exception () const
 
template<typename Callback >
void set_on_completion (Callback c)
 Set a callback that will be invoked when the tasks is completed, no matter if it succeeded or not. More...
 
template<typename Callback >
void set_on_success (Callback c)
 Set a callback that will be invoked if and when the task succeed. More...
 
template<typename Callback >
void set_on_failure (Callback c)
 Set a callback that will be invoked if and when the task fails. More...
 
const std::string & get_guid () const
 

Private Member Functions

virtual bool do_run ()
 
void sync_config ()
 

Private Attributes

Kernelkernel_
 
FetchRemoteConfigPtr fetch_task_
 The task that fetch the data. More...
 
bool sync_general_config_
 
bool autocommit_
 

Detailed Description

Sync the configuration using the configuration fetched from the master server.

Note
This tasks needs to run on the main thread.
The configuration must have been already fetched.

Definition at line 36 of file SyncConfig.hpp.

Constructor & Destructor Documentation

◆ SyncConfig()

SyncConfig::SyncConfig ( Kernel kref,
FetchRemoteConfigPtr  fetch_task,
bool  sync_general_config,
bool  autocommit 
)

Definition at line 31 of file SyncConfig.cpp.

Member Function Documentation

◆ do_run()

bool SyncConfig::do_run ( )
privatevirtual

Implements Leosac::Tasks::Task.

Definition at line 41 of file SyncConfig.cpp.

◆ sync_config()

void SyncConfig::sync_config ( )
private

Definition at line 64 of file SyncConfig.cpp.

Member Data Documentation

◆ autocommit_

bool Leosac::Tasks::SyncConfig::autocommit_
private

Definition at line 53 of file SyncConfig.hpp.

◆ fetch_task_

FetchRemoteConfigPtr Leosac::Tasks::SyncConfig::fetch_task_
private

The task that fetch the data.

Definition at line 50 of file SyncConfig.hpp.

◆ kernel_

Kernel& Leosac::Tasks::SyncConfig::kernel_
private

Definition at line 46 of file SyncConfig.hpp.

◆ sync_general_config_

bool Leosac::Tasks::SyncConfig::sync_general_config_
private

Definition at line 52 of file SyncConfig.hpp.


The documentation for this class was generated from the following files: