[Koha-bugs] [Bug 26791] Build Mojolicious controller replacement for export.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 23 11:04:42 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26791

--- Comment #10 from David Cook <dcook at prosentient.com.au> ---
So it seems that $c->write and $c->write_chunk just put the content in a buffer
rather than actually writing to the socket. (It's too bad they're not called
$c->buffer and $c->buffer_chunk >_>.) 

The buffer doesn't get emptied until "generate_body_chunk" is called... and a
stacktrace suggests in this case it's due to the drain event being fired. 

Then like Node.js, you have recursive callbacks where each callback is called
by an event being fired and that callback processes 1 result and sets up the
next callback.

It's complicated, but it should be performant. If I wrote a native PSGI
handler, it would be blocking, and if you only have 2 Starman workers, that
means 1 whole worker would be occupied with streaming the results of 1 large
export...

I've written to the Mojolicious listserv to see if there is an easier way, but
I think that's probably how it's going to go.

Any more investigation will have to wait until a day where I don't stay at work
until 8pm...

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list