12 using arg_func_t = function<string(string)>;
13 using arg_t = variant<string, arg_func_t>;
14 using arg_pair_t = pair<arg_t, arg_t>;
15 using argv_t = vector<variant<arg_t, arg_pair_t>>;
18 Server(string &&binary_, argv_t && args_ = {});
22 Server(const Server &s);
23 Server &operator = (const Server &s);
25 Server &operator = (Server &&s) = default;
26 Server(Server &&s) = default;
30 const string &getBinary() const;
32 const argv_t &getArgs() const;
34 const socket_or_port_t &getSocketOrPort() const;
36 optional<pid_t> start();
39 bool signal(int signo = SIGTERM);
43 bool wait(int flags = 0);
51 unordered_map<int, unsigned> signalled;
52 socket_or_port_t socket_or_port = 11211;
55 vector<char *> createArgv();
56 optional<string> handleArg(vector<char *> &arr, const string &arg, const arg_func_t &next_arg);