Replies: 1 comment
-
When I use it, an error appears, but there is no information |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
In common practices with streaming APIs,
A.pipe(B)
means "pipe the readable stream A to B." However, the Hono streaming helper APIstream.pipe(A)
means "pipe the readable stream A to the stream` and it goes against the practices. This confused me when I first saw it.I suggest renaming
pipe
method todrain
, as it reflects the actual behavior if keeping that API shape.Anyway, since Hono can directly return readable streams from handlers, I don't fully get its use cases yet. Is it intended for manipulating and combining streams imperatively?
Edit:
I found some articles providing example code that uses the
stream()
helper to just respond with a readable stream, From what I understand so far, thestream()
helper is used similarly toc.text()
andc.json()
API. If so, there may be astreamOf(readable)
orstream(readable)
API for the simple purpose just returning a readable stream.Beta Was this translation helpful? Give feedback.
All reactions