Project

em-whois

0.0
No commit activity in last 3 years
No release in over 3 years
Asynchronous WHOIS queries via EventMachine (based on synchronous whois gem)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

em-whois Build Status

This is a container for the synchronous WHOIS gem which replaces socket communications with the EventMachine equivalent. The result is a gem permitting asynchronous WHOIS lookups.

em-whois is EventMachine-aware, meaning that it'll use asynchronous sockets when called inside the reactor, and fallback to original sockets outside the reactor context.

Supported Ruby Versions

em-whois requires ruby 2.0+, with which it has been tested and used in production.

Examples

Simple example to check domain availability via WHOIS within the EventMachine loop:

require 'em-whois'
require 'whois-parser'

EM.synchrony do
  whois = Whois.whois(ARGV[0] || "github.com")
  puts whois.parser.available? ? "Domain Available" : "Domain Taken"
  EM.stop
end

Also take a look at the async examples in examples/.

License & Notes

The MIT License - Copyright (c) 2012 Mike Jarema