Hi all,

I've read through all the documentation that I can find, and I'm having 
trouble understanding how Mojolicious renders streams. 

I have 
seen https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Streaming, 
but is the drain callback really the only solution? It's a very awkward 
construct, and while it is streaming out data, I think there's an issue 
with the callback I'm using, which I'll have to investigate another time...

I've read the documentation, but I can't 
get https://docs.mojolicious.org/Mojolicious/Controller#write 
or https://docs.mojolicious.org/Mojolicious/Controller#write_chunk to work 
apart from the aforementioned drain callback, even though the documentation 
says "Calling this method without a chunk of data will finalize the 
response headers and allow for dynamic content to be written later."

Typically, with a stream, you'd just write the HTTP headers, and then just 
start writing out your content. I don't understand why it's so challenging 
with Mojolicious. I figured finalizing the response headers would be what I 
needed, but now I have no idea.  

I'm not trying to do anything fancy. I'm just trying to read records from a 
database, and write them out to in a stream to the browser. I would think 
many people would have this same use case without doing anything too 
complicated in their web framework.

Anyway, hoping that someone is able to point me in the right direction. 


-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/09651d60-727d-43d7-b381-c46b1d3aea1cn%40googlegroups.com.

Reply via email to