Replies: 1 comment
-
| 
         When I use it, an error appears, but there is no information  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
pipemethod 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