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

split server into http and rpc parts

this is initial preparation for a larger refactor
This commit is contained in:
Oliver Giles
2019-09-27 20:50:46 +03:00
parent 4614ada1d3
commit 4a07e24da3
8 changed files with 606 additions and 465 deletions

View File

@@ -26,6 +26,8 @@
#include <functional>
struct LaminarInterface;
struct Http;
struct Rpc;
// This class abstracts the HTTP/Websockets and Cap'n Proto RPC interfaces
// and manages the program's asynchronous event loop
@@ -61,15 +63,10 @@ private:
private:
int efd_quit;
capnp::Capability::Client rpcInterface;
LaminarInterface& laminarInterface;
kj::AsyncIoContext ioContext;
kj::HttpHeaderTable headerTable;
kj::Own<kj::HttpService> httpService;
kj::Own<kj::HttpServer> httpServer;
kj::Own<kj::TaskSet> listeners;
kj::TaskSet childTasks;
kj::TaskSet httpConnections;
kj::Maybe<kj::Promise<void>> reapWatch;
int inotify_fd;
kj::Maybe<kj::Promise<void>> pathWatch;
@@ -77,6 +74,10 @@ private:
// TODO: restructure so this isn't necessary
friend class ServerTest;
kj::PromiseFulfillerPair<void> httpReady;
// TODO: WIP
kj::Own<Http> http;
kj::Own<Rpc> rpc;
};
#endif // LAMINAR_SERVER_H_