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

Fetch the configuration from master server. More...

#include <FetchRemoteConfig.hpp>

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

Public Member Functions

 FetchRemoteConfig (const std::string &endpoint, const std::string &pubkey)
 
const RemoteConfigCollectorcollector () const
 
- 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
 

Static Public Attributes

static constexpr const int timeout = 2000
 

Private Member Functions

virtual bool do_run () override
 

Private Attributes

zmqpp::context ctx_
 
RemoteConfigCollector collector_
 

Detailed Description

Fetch the configuration from master server.

This tasks should be scheduled in a pool thread.

Definition at line 35 of file FetchRemoteConfig.hpp.

Constructor & Destructor Documentation

◆ FetchRemoteConfig()

FetchRemoteConfig::FetchRemoteConfig ( const std::string &  endpoint,
const std::string &  pubkey 
)

Definition at line 26 of file FetchRemoteConfig.cpp.

Member Function Documentation

◆ collector()

const RemoteConfigCollector & FetchRemoteConfig::collector ( ) const

Definition at line 39 of file FetchRemoteConfig.cpp.

◆ do_run()

bool FetchRemoteConfig::do_run ( )
overrideprivatevirtual

Implements Leosac::Tasks::Task.

Definition at line 34 of file FetchRemoteConfig.cpp.

Member Data Documentation

◆ collector_

RemoteConfigCollector Leosac::Tasks::FetchRemoteConfig::collector_
private

Definition at line 48 of file FetchRemoteConfig.hpp.

◆ ctx_

zmqpp::context Leosac::Tasks::FetchRemoteConfig::ctx_
private

Definition at line 47 of file FetchRemoteConfig.hpp.

◆ timeout

constexpr const int Leosac::Tasks::FetchRemoteConfig::timeout = 2000
staticconstexpr

Definition at line 40 of file FetchRemoteConfig.hpp.


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