Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Resolve domain names from EventMachine with libasyncns

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 ext
Octocat-spinner-32 lib
Octocat-spinner-32 patches
Octocat-spinner-32 spec
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION.yml
Octocat-spinner-32 em-asyncns.gemspec
README.md

Motivation

Connecting to hostnames from EventMachine? Dissatisfied from the Dnsruby experience? Disappointed by the lack of EventMachine support in Dnsruby trunk? Then you want this.

Usage

    require 'em/resolver'

    EM.run {
      res = EventMachine::Resolver.new
      q = res.getaddrinfo("localhost")
      q.callback do |addresses|
        addresses.each { |address|
          spam! address
        }
      end
      q.errback do |error|
        puts "Oh noes: #{error}"
      end
    }

Dnsruby compatibility

A drop-in replacement for Dnsruby is provided given you use the library exactly as stated in the EventMachine FAQ.

See spec/dnsruby_spec.rb for details.

ext/asyncns.h

...is included in a slightly modified form because the original one had parameter names like `class' which prevents compiling as C++.

Something went wrong with that request. Please try again.