I am modernising a Perl-based system for a client. This system runs on Windows (Strawberry Perl), connects to a database, and calls some scripts, which in turn run other programs.
My first thought is to write a PSGI application and trigger the application using curl. My initial experiments seem to be working, although only using the Twiggy server. (Thrall leaks memory badly, and forking servers like Starman don't work on Windows.)
I'd like to improve the system further by running the other external commands in parallel. I've tried using AnyEvent or Parallel::ForkManager. It works for standalone scripts, but when running inside of Twiggy, Perl crashes.
My question is: how can I execute external commands in parallel so that Twiggy (or an alternative server, if this is an issue with Twiggy) so that it doesn't crash?