Subject: | Net::DNS::Nameserver::main_loop alternative |
Net::DNS::Nameserver seems like a great tool, but the fact that it needs to take over the main runnning thread limits its audience. Since many daemon programs are already driven by a top level select loop, it seems useful to provide an API for the user to integrate Net::DNS::Nameserver processing to their own select loop.
To show a possible implementation, the patch I have included delays the creation of the IO::Select object until main_loop() is entered using two new methods $obj->handles and $obj->process_client. With these, a user could integrate these handles into their own select loop. Their only obligation is to call process_client() each time one of the sockets is ready for reading.
This of course is not full asynchronous processing, but is a step in that direction.
Message body not shown because it is not plain text.