in reply to Re: "Web server embedding" (Mojolicious docs)
in thread "Web server embedding" (Mojolicious docs)

Thanks. Just placing code from the very first link in OP to a separate thread (e.g. with IO::Async::Routine) gave me nothing, because Mojo::IOLoop-> one_tick blocks again, and Routine won't accept commands from 'main' loop. So, a Mojo::IOLoop::Stream (?) must be added to Mojo's loop for communication. For which I need some time to figure it all out. Or, otherwise, ugly timers, be it separate thread or not.

OTOH, staying within IO::Async (Net::Async) namespaces, the Net::Async::HTTP::Server and Net::Async::WebSocket::Server solved, partly, what this all was about, with a single event loop. Just partly.

Closing browser (hence Websocket connection) leads to instantaneous on_close and "WebSocket closed with status 1001" using simple Mojolicious application. But in "pure" IO:Async (Net::Async) app I get on_frame event with WebSocket frame being 2 characters "\x{03}\x{fffd}". What does it mean, how to parse it? Does it have to (and will it) be so low level all the way ahead?

On still another hand, I just wanted to experiment with Mojolicious, use it within existing IO:Async app. Sorry for this rant :)