grpc pagination: sync channel

445 views
Skip to first unread message

qian...@gmail.com

unread,
Aug 1, 2017, 7:21:12 PM8/1/17
to grpc.io
Hi Grpc exports,

We have a client-server project, where client (C++) needs to send a lot of data to server every a few seconds. Often there are 60000 records ready to be sent to server per round , each record about 400-byte.  So we decide to do pagination (chunking):  1 page has  1000 records.  MY question is:


    1.how to do paging, without close/open stream channel every time
        it seems after writer->WritesDoen() and Finish(), the channel is closed, so I have to reopen the same channel immediately for the 2nd page.  But If I don't call writer->WritesDone and Finish(), this page is not sent. I really want send every page with the same writer, and not close the channel in between.

  1. keep the channel open forever:
    Since the client is sending data as long as it is alive, to the same server/port, is there a way to keep the sync channel open for sending, for as long as the client process is alive, maybe for a few days/months...  


    thanks!
    Qian

David Garcia Quintas

unread,
Sep 8, 2017, 11:36:26 AM9/8/17
to grpc.io
Why not using a streaming call? Your usecase would fit perfectly with its semantics. Have a look at the relevant sections of the guide.
Reply all
Reply to author
Forward
0 new messages