-
Notifications
You must be signed in to change notification settings - Fork 13
NettyTcpServer
as a Publisher<Connection>
#7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The Reactive Streams contract provides the same events in processing a connection as a dedicated abstraction would. It just uses different names. At the server level these would be:
At a connection level, these events correspond to:
|
As I mentioned under Issue 5 I see no reason why use a reactive streams Publisher for new connections. Can reactive back-pressure even be applied in this case? Connections arrive at the rate they will, it's not something we can push back on. It almost sounds like the intent is to do some kind of load balancing but I can't quite see how this is the right place to do that. Also by making the server a Publisher isn't that basically saying that a server is parameterized to handle one protocol only? I would much prefer to see a dedicated abstraction for protocol handling. |
@jbrisbin I was referring to not having a handle on the processing of a connection which can be cancelled if need be.
Yes, one can stop accepting connections on a server by changing the selector interest sets. Netty provides this via turning off Having said that, I don't think this is the correct abstraction for the reason I mentioned in this issue. |
@NiteshKant @rstoyanchev added two commits to change how connections are handled. The first implements write functionality and removes the |
May I suggest that we follow the pull-request model for changes in the repo? That makes it easier to follow changes :) |
Closing as we agreed on not representing a server as a |
This issue is to discuss the current implementation of
NettyTcpServer
which is aPublisher<Connection>
The issue with this design is that there is no way to get a handle of the lifecycle of connection processing. There are various ways in which a server would like to manage the lifecycle of a connection processing:
Publisher<HttpRequest>
. If so, then request cancellation is a first class usecase, for which we would need a handle to request processing, without closing the connection.By modeling a server as a
Publisher
ofT
we can not get an async representation of the processing ofT
, since the notification ispublic void onNext(T t)
The text was updated successfully, but these errors were encountered: