Hi akkartik - Thank you! Your code helped me greatly. there's an issue though with it. The spawn actually needs to happen after the socket is connected. see this for an example:
I tried this on win32 and it works fine. You can see the effect of the thread if you put a (sleep 5) before the dispatch. Multiple requests can connect and then each completes 5 seconds later.
The spawn doesn't happen quite where it does in your version, so I think the master ends up doing a little more work per request. Let me know if that has implications; I think you know more about this.
[1] Buggy version, but next commit was good. Just do a git pull.