weppos/whois — pull request #189 by weppos (2012-10-16 12:02:34+00:00)
Title: Customizable query handler

This (experimental) feature allows you to write custom query handlers and replace the default synchronous socket-based handler with any custom handler.

The query handler handles is the low-level connection between the library and the external WHOIS source. As of today, the only way to use a different connection mechanism/technology is by monkey-patching the library.

**Why you may want to change the query handler?**

There are hundreds of reasons why you may want to do that. Here's a few:

- In your testing environment you might want to use a `TestHandler` to avoid performing real external connections. If you ever used the whois library in a real Ruby app with tests, you probably ended up using a lot of mocked and stubbed objects.
- To perform super-fast multiple lookups, you may want to write an asyncronous handler using EM, Celluloid or your favourite async library
- If you need to interact with multiple systems, you might want to use a distributed architecture or a queue system.