Commit ad133cad authored by Kenton Varda's avatar Kenton Varda

Make UnixEventPort accessible through AsyncIoContext.

parent 7450fc8b
......@@ -792,6 +792,8 @@ public:
Timer& getTimer() override { return timer; }
UnixEventPort& getEventPort() { return eventPort; }
private:
UnixEventPort eventPort;
EventLoop eventLoop;
......@@ -987,7 +989,7 @@ AsyncIoContext setupAsyncIo() {
auto lowLevel = heap<LowLevelAsyncIoProviderImpl>();
auto ioProvider = kj::heap<AsyncIoProviderImpl>(*lowLevel);
auto& waitScope = lowLevel->getWaitScope();
return { kj::mv(lowLevel), kj::mv(ioProvider), waitScope };
return { kj::mv(lowLevel), kj::mv(ioProvider), waitScope, lowLevel->getEventPort() };
}
} // namespace kj
......@@ -31,6 +31,8 @@
namespace kj {
class UnixEventPort;
class AsyncInputStream {
// Asynchronous equivalent of InputStream (from io.h).
......@@ -296,6 +298,10 @@ struct AsyncIoContext {
Own<LowLevelAsyncIoProvider> lowLevelProvider;
Own<AsyncIoProvider> provider;
WaitScope& waitScope;
UnixEventPort& unixEventPort;
// TEMPORARY: Direct access to underlying UnixEventPort, mainly for waiting on signals. This
// field will go away at some point when we have a chance to improve these interfaces.
};
AsyncIoContext setupAsyncIo();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment