> > 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. >
The drain callback is the only way, because we use an event loop and non-blocking I/O. The whole thing could theoretically be wrapped in promises and then made to look blocking with async/await, but that doesn't really change how it works internally. -- sebastian -- 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/c4412264-2954-4f5b-a0ed-45f506d53df4n%40googlegroups.com.