Skip to content
This repository has been archived by the owner on Jul 31, 2021. It is now read-only.

jmkeyes/em-udns-multi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventMachine::Udns::Multi

Aggregate a large number of asynchronous DNS queries together using em-udns.

Installation

Add this line to your application's Gemfile:

gem 'em-udns-multi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install em-udns-multi

Usage

The following example is trivial but can be expanded on significantly.

#!/usr/bin/env ruby

require 'eventmachine'
require 'em-udns'
require 'em-udns-multi'

EventMachine.run do
  # Create an aggregate resolver that must complete within 250ms.
  resolver = EventMachine::Udns::Multi.new(0.250)

  resolver.callback do |results|
    puts "[x] Got a response: #{results.inspect}"
    EventMachine.stop
  end

  resolver.query(:google, 'google.com', 'A')
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Batch up DNS queries and fire a callback with the aggregated result. Useful for checking DNS RBLs and other bulk DNS services.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages