On 24/12/2011 05:34, Marvin Humphrey wrote:
On Fri, Dec 23, 2011 at 08:36:02PM +0100, Nick Wellnhofer wrote:
On 23/12/11 03:52, Marvin Humphrey wrote:
Can we somehow make SearchServer pluggable or subclassable so that the user
can supply routines for forking/preforking/etc?
I think the easiest solution would be to move the guts of the request
handling from SearchServer to another module. This could then be used
from different server modules.
How about we expose a handle_request() method on SearchServer which takes a
socket handle as an argument, reads the incoming request and sends a response
back?
=head2 handle_request
$search_server->handle_request($sock);
Process a request from a socket handle which is ready for reading.
That's what I had in mind. But if we want to use Net::Server, we can't
use SearchServer's constructor in its current form. So I would split
SearchServer into two classes.
Nick