RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Public Attributes
RTBKIT::MasterBanker Struct Reference

#include <master_banker.h>

Inheritance diagram for RTBKIT::MasterBanker:
Datacratic::ServiceBase Datacratic::RestServiceEndpoint RTBKIT::MonitorProvider Datacratic::EventRecorder Datacratic::MessageLoop Datacratic::Epoller Datacratic::AsyncEventSource

List of all members.

Public Types

typedef ML::Spinlock Lock
typedef std::unique_lock< Lock > Guard

Public Member Functions

 MasterBanker (std::shared_ptr< ServiceProxies > proxies, const std::string &serviceName="masterBanker")
void init (const std::shared_ptr< BankerPersistence > &storage)
void start ()
std::pair< std::string,
std::string > 
bindTcp ()
void shutdown ()
void bindFixedHttpAddress (const std::string &uri)
Json::Value createAccount (const AccountKey &key, AccountType type)
void saveState ()
void loadStateSync ()
void onStateLoaded (std::shared_ptr< Accounts > newAccounts, BankerPersistence::PersistenceCallbackStatus status, const std::string &info)
void onStateSaved (BankerPersistence::PersistenceCallbackStatus status, const std::string &info)
std::string getProviderName () const
Json::Value getProviderIndicators () const

Public Attributes

std::shared_ptr
< BankerPersistence
storage_
RestRequestRouter router
Accounts accounts
Date lastSavedState
BankerPersistence::PersistenceCallbackStatus lastSaveStatus
Lock saveLock
int saving
MonitorProviderClient monitorProviderClient
Date lastWin
Date lastImpression

Detailed Description

Master banker class. This provides a REST interface to an underlying banker implementation.

Definition at line 238 of file master_banker.h.


Member Function Documentation

void RTBKIT::MasterBanker::bindFixedHttpAddress ( const std::string &  uri)

Bind the HTTP REST endpoint to the given address on a fixed port, for services that must be discoverable via DNS.

The address will still be published into Zookeeper.

example: "*:4444", "localhost:8888"

Definition at line 612 of file master_banker.cc.

string RTBKIT::MasterBanker::getProviderName ( ) const [virtual]

MonitorProvider interface

Implements RTBKIT::MonitorProvider.

Definition at line 619 of file master_banker.cc.

Load the entire state sychronously. Will return once the state has been loaded.

Definition at line 588 of file master_banker.cc.

Save the entire state asynchronously. Will return straight away.

Definition at line 549 of file master_banker.cc.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator