Closed NiteshKant closed 9 years ago
@NiteshKant Can you rebase this for consideration to merge?
@jbrisbin @smaldini This feels like a good first step towards getting a protocol working end-to-end with all the layers (transport, core, adaptor) and example code.
There is a lot to discuss and this is far from production worth, and the APIs are most definitely not all correct, but I propose we merge this and use it to start iterating with further pull requests and discussion.
BTW, once we have a good approach we can migrate the tcp protocol code to its own project as per https://github.com/reactive-ipc/reactive-ipc-jvm/issues/18
@benjchristensen the code seems to be on the latest from upstream and is ready to be merged.
:+1:
@NiteshKant The question about rebasing was whether we should retain the 7 commits for this, or squash to 1 commit.
Ideally they should be squashed to 1.
Looks like my attempt to squash across merge commits rendered this PR unusable :( Lemme try to fix it
You shouldn't need the merge commit. You can just rebase on top of the master branch. Or just checkout master again from scratch, branch, then copy/paste your code and commit a single clean commit.
FWIW @rstoyanchev @smaldini and I are going to be going over this in a more comprehensive way today as we individually evaluate some of these approaches and then get together to discuss them to offer more comprehensive feedback than is possible in line comments.
How would we handle connection close events and reconnects?
FWIW @rstoyanchev @smaldini and I are going to be going over this in a more comprehensive way today as we individually evaluate some of these approaches and then get together to discuss them to offer more comprehensive feedback than is possible in line comments.
All great questions @jbrisbin . I will reply to them so that you guys have more context on these when you discuss them.
FWIW We talked about this for 3 hours yesterday and have several concrete thoughts about some of these issues. I'm putting together some code to illustrate our thoughts and I'll try and create a summary of our discussion to point out the things we think are important. I'm just trying to figure out how the concepts and suggestions encoded in this PR converge with some of the other things we talked about and how we could bring them closer together.
TL;DR we don't think this PR is all that far away from where we probably need to be to do the kinds of things we need to do in the varied use cases we have (many of which vary quite radically from one another). That said, we do find a few things problematic and I'll try and explain why and demonstrate with code in a separate PR, which we can hopefully use as discussion points to iterate again on something that meets both needs.
we don't think this PR is all that far away from where we probably need to be to do the kinds of things we need to do in the varied use cases we have
Great! Eager to hear your opinions.
That said, we do find a few things problematic and I'll try and explain why and demonstrate with code in a separate PR
Would it help if this is merged or your PR would be orthogonal to these changes?
I think these changes will be too different to do much in the way of a merge. What I hope will happen is that we discuss the pros and cons of both PRs on their own merits and then prepare another PR that iterates on those ideas. That PR would then be merged to provide the next round, etc...
@jbrisbin sounds great!
I have removed interception and flush semantics from this PR.
Currently experimenting with this too with reactor, will update asap but looks nice, although the backpressure thing is not simple, not because of the value but because when requesting from inside netty thread it might clash with the onNext written data (some from a different thread, some from the same than netty which then applies the write directly).
I've aligned the reactor-net GA with the semantics in order to move forward easily in the future.
@smaldini I did not implement backpressure in this PR to focus discussion on the API and we can discuss backpressure separately. Backpressure isn't straight forward and just like you are solving it for reactor, I have solved it for RxNetty, it will be great to discuss the details of the same.
For now, I will merge this PR so that we can iterate upon specifics from here.
Based on various discussions around different issues, I am proposing a fresh design for a TCP server in this PR. I have implemented a TCP server at all layers in reactive-ipc, i.e. core, transport(netty) and rxjava1. I have also removed all code which isn't related to the implementation. We can discuss those utilities in isolation as and when required to be added. Although, not used, I have kept the
Buffer
and related classes as that aspect is not yet discussed to conclusion.There are two samples each for netty transport and rxjava1 layer available to see how will a typical interaction look like in modules ripc-transport-netty4-examples and ripc-rxjava1-examples
Backpressure has not been implemented yet.