Skip to content
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

Flow control support #3

Open
vietj opened this issue Apr 16, 2017 · 10 comments
Open

Flow control support #3

vietj opened this issue Apr 16, 2017 · 10 comments

Comments

@vietj
Copy link
Contributor

vietj commented Apr 16, 2017

No description provided.

@vietj
Copy link
Contributor Author

vietj commented Apr 16, 2017

@pmlopes I've started to implement flow-control for gRPC streams

I need your help on this feature as there is a timing issue when the GrpcWriteStreamImpl is created for a client that prevents adding a CallStreamObserver onReadyListener.

The failing test to look at is FlowControlTest#testStreamSink.

@vietj
Copy link
Contributor Author

vietj commented Apr 16, 2017

It looks to me that in the case of an GrpcUniExchange we create first the ReadStream and then the WriteStream and it looks to me that we should do both at the same time.

@vietj
Copy link
Contributor Author

vietj commented May 10, 2017

@pmlopes
Copy link
Member

pmlopes commented May 10, 2017

The order of creation is a bit locked to the underlying API but I'll see if we can fix it.

@pmlopes
Copy link
Member

pmlopes commented May 11, 2017

@vietj the writeStream is initialized by gRPC itself in a private method:

    private static <ReqT, RespT> StreamObserver<ReqT> asyncStreamingRequestCall(ClientCall<ReqT, RespT> call, StreamObserver<RespT> responseObserver, boolean streamingResponse) {
        ClientCalls.CallToStreamObserverAdapter<ReqT> adapter = new ClientCalls.CallToStreamObserverAdapter(call);
        startCall(call, new ClientCalls.StreamObserverToCallListenerAdapter(call, responseObserver, adapter, streamingResponse), streamingResponse);
        return adapter;
    }

And then the class StreamObserverToCallListenerAdapter will call the freeze method on the observable, so when we try to set the setOnReadyHandler handler it will fail.

Also the transformation from pure StreamObserver to CallStreamObserver happens at the internal gRPC level (not at the code generation by the compiler) so there is no way to get a reference to that object before hand to set the handler.

@EmadAlblueshi
Copy link

Will be available in 3.5 ?

@vietj
Copy link
Contributor Author

vietj commented Aug 10, 2017

not an active area of development right now...

@anhldbk
Copy link

anhldbk commented Jul 2, 2019

@vietj Do you need any help to resolve this issue?

@vietj
Copy link
Contributor Author

vietj commented Jul 2, 2019

any contribution would be valuable

@bbemis017
Copy link

Is there any update on this? or any known workarounds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants