Skip to content

Asynchronous whois based on weppos' synchronous whois gem

Notifications You must be signed in to change notification settings

mikejarema/em-whois

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Asynchronous whois based on weppos' synchronous whois gem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages