Skip to content

Commit 5cfd385

Browse files
leheckafacebook-github-bot
authored andcommitted
separating HttpServer from HttpConnectionAcceptor
Summary: this is to allow customization of http server and handling requests early feedfback welcome Differential Revision: D4940509 fbshipit-source-id: 618b5588b078ef7c350192e42316f24c6bc1751e
1 parent 28b652f commit 5cfd385

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

experimental/rsocket/ConnectionAcceptor.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
namespace rsocket {
1111

12+
using OnDuplexConnectionAccept = std::function<
13+
void(std::unique_ptr<reactivesocket::DuplexConnection>, folly::EventBase&)>;
14+
1215
/**
1316
* Common interface for a server that accepts connections and turns them into
1417
* DuplexConnection.
@@ -39,9 +42,7 @@ class ConnectionAcceptor {
3942
* This can only be called once.
4043
*/
4144
virtual folly::Future<folly::Unit> start(
42-
std::function<void(
43-
std::unique_ptr<reactivesocket::DuplexConnection>,
44-
folly::EventBase&)> onAccept) = 0;
45+
OnDuplexConnectionAccept onAccept) = 0;
4546
// TODO need to add numThreads option (either overload or arg with default=1)
4647
};
4748
}

0 commit comments

Comments
 (0)