Mojo::Server::Prefork alternative for Windows

67 views
Skip to first unread message

Thomas Kratz

unread,
Dec 20, 2016, 10:48:40 AM12/20/16
to Mojolicious
Hi,

I have created a Mojo::Server::Threaded to be mainly usable in Windows
environments where Mojo::Server::Prefork is not available. I just started with Mojo::Server::Prefork
and exchanged the fork and pipe with threads and queues. The changes are not that extensive.  

A proof of concept is running nicely so far, but I had to make two small changes to
Mojo::Server::Daemon and Mojo::IOLoop::Server because Windows threads have to reopen
the socket from the file descriptor of the first listener.

The purpose of the changes is to add a new attribute (e.g. 'use_fd') to Mojo::Server::Daemon
that will be passed as argument to listen() in Mojo::IOLoop::Server. Creating the socket from
the file descriptor is already implemented for the 'reuse' functionality, so that was trivial.

Before I invest more work into that, it would be good to know whether this is something that
could be integrated in future releases. Otherwise this would be futile.

The goal is to either have a working hypnotoad under windows or to have an
alternative for that. Since the interface is identical this could be a dropin replacement for 
Mojo::Server::Prefork.  

Thomas

      

sri

unread,
Dec 20, 2016, 11:52:17 AM12/20/16
to Mojolicious
Before I invest more work into that, it would be good to know whether this is something that
could be integrated in future releases. Otherwise this would be futile.

That question is usually better answered on IRC, here you might have to wait some time to
get feedback. Personally, i don't have time to look into this right now, but i can tell you that
Hypnotoad already works on windows with WSL.


--
sebastian

Kmx

unread,
Dec 20, 2016, 1:05:59 PM12/20/16
to Mojolicious
Couple of years ago I have tried something similar.

You might be interested in looking at https://github.com/kmx/mojo-server-metyl

It will definitely not work with current Mojolicious (it was Mojolicious-3.x era at that time).

--kmx
Reply all
Reply to author
Forward
0 new messages