-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Requesting Clarity for new Streaming Feature #732
Comments
To elaborate further on the object -> JSON question, if I implement my server side as a typed generator that produces something other than string the inferred client type in treaty is AsyncGenerator but in fact I just get the string |
Sorry for the drip feed of info but the behavior is actually weirder than I first thought -- if I manually call JSON.stringify on the server, the values produced by
are objects rather than strings. This causes some significant typescript issues as I need to type the generator as string (but it actually returns objects) edit to add I see that 1.1.3 was released today to address other issues related to the stream feature. I have updated and this appears to still be the case. |
Currently implementing it using the Generator function as described in the docs, using |
Not sure it's strictly on the Eden side -- I've definitely seen cases where only one object is emitted and it still serializes onto the wire as [object Object], but if manually stringified with JSON.stringify it goes onto the wire as JSON (of course) and is parsed by Eden. Given the content type is text/event-stream I would expect that the wire format is newline delimited and simultaneous emissions should not be an issue? |
A few issues related to the new async generator feature for streaming responses, one of which applied to the legacy method as well.
ReadableStream
and then iterate the stream but maybe I'm missing something that allows skipping some of the ceremonyThe text was updated successfully, but these errors were encountered: