RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
core/banker/testing/banker_temporary_server.h
00001 /* banker_temporary_server.h                                        -*- C++ -*-
00002    Jeremy Barnes, 19 October 2012
00003    Wolfgang Sourdeau, 20 December 2012
00004    Copyright (c) 2012 Datacratic Inc.  All rights reserved.
00005 
00006    A temporary server for testing of banker-based services. Starts one up in a
00007    temporary directory and gives the uri to connect to. */
00008 
00009 // #include "jml/utils/environment.h"
00010 // #include "jml/utils/file_functions.h"
00011 // #include "jml/arch/timers.h"
00012 // #include "soa/service/redis.h"
00013 // #include <sys/stat.h>
00014 // #include <sys/types.h>
00015 // #include <sys/wait.h>
00016 // #include <sys/un.h>
00017 // #include <sys/socket.h>
00018 // #include <signal.h>
00019 
00020 #include <string>
00021 #include <vector>
00022 
00023 #include <boost/noncopyable.hpp>
00024 
00025 
00026 namespace RTBKIT {
00027 
00028 struct BankerTemporaryServer : boost::noncopyable {
00029     BankerTemporaryServer(const Redis::Address & redisAddress,
00030                           const std::string & zookeeperUri,
00031                           const std::string & zookeeperPath = "CWD");
00032     ~BankerTemporaryServer();
00033 
00034     void start();
00035     void shutdownWithSignal(int signal);
00036     void shutdown(); /* SIGTERM */
00037     void exterminate(); /* SIGKILL */
00038 
00039     Redis::Address redisAddress_;
00040     std::string zookeeperUri_;
00041     std::string zookeeperPath_;
00042     int serverPid_;
00043 };
00044 
00045 } // namespace RTBKIT
00046 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator