#include #include #include #include // Add executors here #include // Add loggers here #include #include struct Options { std::string listenIP = "localhost"; fs::path logFile = "daggy.log"; uint16_t listenPort = 2503; size_t webThreads = 50; size_t dagThreads = 20; size_t taskThreads = 20; }; int main(int argc, char **argv) { Options options; argparse::ArgumentParser args("Daggy"); args.add_argument("-v", "--verbose"); args.add_argument("-c", "--config") .help("Config file"); args.add_argument("--ip") .help("IP address to listen to"); args.add_argument("--port") .help("Port to listen to") .action([](const std::string &value) { return std::stoi(value); }); std::ofstream logFile(options.logFile, std::ios::app); daggy::loggers::dag_run::OStreamLogger logger(logFile); daggy::executors::task::ForkingTaskExecutor executor(options.taskThreads); Pistache::Address listenSpec(options.listenIP, options.listenPort); daggy::Server server(listenSpec, logger, executor, options.dagThreads); server.init(options.webThreads); server.start(); }