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

Any way to use a grpc method as an RxJava observable? #163

Closed
parrotcar00 opened this issue Nov 5, 2020 · 2 comments
Closed

Any way to use a grpc method as an RxJava observable? #163

parrotcar00 opened this issue Nov 5, 2020 · 2 comments

Comments

@parrotcar00
Copy link

parrotcar00 commented Nov 5, 2020

I have a simple use case of where I want to expose a RxJava observable through a stream method. I have code like:
`Observable myPojoSource = Observable.just(myPojo);

    myPojoSource.subscribe(myPojo -> {

        //Here I want to call my Grpc method
        myGrpcMethod(myPojoe, responseObserver); //How do I get hold of this responseObserver variable?

    });`

But how do I get hold of that responseObserver variable? Is there anyway to get it?

@parrotcar00
Copy link
Author

To give some more context, I have a pojo on my Grpc server that gets updated in a hard to predict fashion. So it seemed like best to use RxJava to assign a subscriber call back method to work with this pojo.
Now I want to expose this pojo through a Grpc stream returning method but I'm confused how to call the grpc stream stub from the observer callback?

jvmlet added a commit that referenced this issue Apr 11, 2023
@jvmlet
Copy link
Collaborator

jvmlet commented Apr 11, 2023

Please have a look at test in this commit

@jvmlet jvmlet closed this as completed Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants