On 27/12/11 21:33, Marvin Humphrey wrote:
Ah, I see that you have a process_request() method in the LUCY-205 patch already -- and though it does not take a socket-handle/fileno as an argument, it can be modified easily to do so.
That's an implementaion detail of Net::Server. To use Net::Server, you simply subclass it and implement a process_request method.
I think that means that we cannot simply delete SearchServer#serve -- though we can improve on things by making it possible to override serve() or otherwise avoid it.
IMO subclassing SearchServer as it is now wouldn't be the best solution if it's possible at all. First, we can't use the SearchServer constructor because we don't want the sockets to be created there. Then, AFAIU classes derived from Lucy::Object::Obj must be inside-out. Is it safe to subclass additional Perl classes like Net::Server that use their own hashref attributes in the traditional way?
Another solution would be to simply duplicate the SearchServer request handling code in an external module. That's not very elegant but maybe it's the easiest way to go, at least for now.
Nick
