in reply to Re^3: How do I make a PSGI program do costly initialisation only once per process, not per thread?
in thread How do I make a PSGI program do costly initialisation only once per process, not per thread?
comment out line #38 (loader => 'Delayed') in thrall.batYou hit the nail on the head, bravo! So to make this crystal clear, the loader type is responsible for the difference in initialisation, not the server type itself, and with thrall, the delayed loading is on purpose.
Will this change to .bat break anything?Yes, very much. It appears there is a lot of thread-unsafe code in my application. Let me show y'all a bizarre example:
With plackup, the response is []. With thrall but no Delayed loader, the response is Internal Server Error, the exception hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at ….use JSON qw(encode_json); my $app = sub { return [200, [], [encode_json [] ]] };
|
|---|