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

Wait until get all Blogs #5

Open
arturmkr opened this issue Jul 21, 2021 · 0 comments
Open

Wait until get all Blogs #5

arturmkr opened this issue Jul 21, 2021 · 0 comments

Comments

@arturmkr
Copy link

There is a method, which returns stream response of Blog:

 public java.util.Iterator<com.proto.blog.ListBlogResponse> listBlog(
        com.proto.blog.ListBlogRequest request) {
      return blockingServerStreamingCall(
          getChannel(), getListBlogMethod(), getCallOptions(), request);
    }

To print each blog one be one:

        blogClient.listBlog(ListBlogRequest.newBuilder().build()).forEachRemaining(
                listBlogResponse -> System.out.println(listBlogResponse.getBlog().toString())
        );

But if it's needed on client to wait until getting all blogs and having it as com.proto.blog.ListBlogResponse, what's the best option to do?

@simplesteph , could you please help

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

1 participant