RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
examples/augmentor_ex_runner.cc
00001 
00009 #include "augmentor_ex.h"
00010 #include "soa/service/service_utils.h"
00011 
00012 #include <boost/program_options/cmdline.hpp>
00013 #include <boost/program_options/options_description.hpp>
00014 #include <boost/program_options/positional_options.hpp>
00015 #include <boost/program_options/parsers.hpp>
00016 #include <boost/program_options/variables_map.hpp>
00017 
00018 #include <iostream>
00019 #include <thread>
00020 #include <chrono>
00021 
00022 
00023 using namespace std;
00024 
00025 /******************************************************************************/
00026 /* MAIN                                                                       */
00027 /******************************************************************************/
00028 
00029 int main(int argc, char** argv)
00030 {
00031     using namespace boost::program_options;
00032 
00033     Datacratic::ServiceProxyArguments args;
00034 
00035     options_description options = args.makeProgramOptions();
00036     options.add_options() ("help,h", "Print this message");
00037 
00038     variables_map vm;
00039     store(command_line_parser(argc, argv).options(options).run(), vm);
00040     notify(vm);
00041 
00042     if (vm.count("help")) {
00043         cerr << options << endl;
00044         return 1;
00045     }
00046 
00047     auto serviceProxies = args.makeServiceProxies();
00048     RTBKIT::FrequencyCapAugmentor augmentor(serviceProxies, "frequency-cap-ex");
00049     augmentor.init();
00050     augmentor.start();
00051 
00052     while (true) this_thread::sleep_for(chrono::seconds(10));
00053 
00054     // Won't ever reach this point but this is how you shutdown an augmentor.
00055     augmentor.shutdown();
00056 
00057     return 0;
00058 }
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator