Maintaining/Re-establising a ClientReadableStream #1292
-
Hello,
Nota bene: I'm relying on TypeScript files generated with the experimental Thanks in advance for your opinions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hi.. :) Just a few quick thoughts..
As far as i know there is NO way to re-establish to the same server stream once the HTTP stream is broken. (they have a 1:1 relationship AFAIU.)
I'd think "error" would be a better signal for when underlying connection fails.
Here is our error handling code, where we also translate http code to status (code). You can probably experiment and find out which ones you see in practice.
Different codegen flavors only affects the API and generally shouldn't affect the capability of the library. :) Not sure if it answers all your questions but hope it helps :) |
Beta Was this translation helpful? Give feedback.
Ahh i hear you. :)
I think the problem is that you're trying to use grpc-web streaming as a long-lived "push channel", where it's not exactly designed to solve that particular use case. As you've mentioned, you need an end-to-end keep-alive mechanism (what you refer to as "ping from time to time") to ensure the other endpoint is still alive, which is not part of grpc in general.
Although, I'm not saying it's not possible to build it on top of grpc-web, but you're gonna need to build a lot more on your application layer — e.g. including things that you asked about like session management, "fetching missing data", and also potentially sticky routing, session resuming, etc. — and those are c…