1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-09-24 12:56:42 +00:00

resolves #34: watch for configuration changes

Reload the configuration if a change is detected
without requiring a server restart
This commit is contained in:
Oliver Giles
2018-04-06 18:04:50 +03:00
parent a5d8b985f1
commit 216ecee7c5
7 changed files with 50 additions and 14 deletions

View File

@@ -43,6 +43,9 @@ public:
// invoked with the read data
void addDescriptor(int fd, std::function<void(const char*,size_t)> cb);
// add a path to be watched for changes
void addWatchPath(const char* dpath);
private:
kj::Promise<void> acceptHttpClient(kj::Own<kj::ConnectionReceiver>&& listener);
kj::Promise<void> acceptRpcClient(kj::Own<kj::ConnectionReceiver>&& listener);
@@ -63,6 +66,8 @@ private:
kj::TaskSet childTasks;
kj::TaskSet httpConnections;
kj::Maybe<kj::Promise<void>> reapWatch;
int inotify_fd;
kj::Maybe<kj::Promise<void>> pathWatch;
// TODO: restructure so this isn't necessary
friend class ServerTest;