Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gmodarelli/em-resolv-replace
EventMachine-aware pure Ruby DNS resolution
https://github.com/gmodarelli/em-resolv-replace
Last synced: 3 months ago
JSON representation
EventMachine-aware pure Ruby DNS resolution
- Host: GitHub
- URL: https://github.com/gmodarelli/em-resolv-replace
- Owner: gmodarelli
- License: mit
- Archived: true
- Created: 2010-02-11T01:26:58.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2016-01-20T14:24:48.000Z (almost 9 years ago)
- Last Synced: 2024-05-11T15:03:18.705Z (6 months ago)
- Language: Ruby
- Homepage:
- Size: 19.5 KB
- Stars: 68
- Watchers: 5
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.rdoc
- Changelog: History.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= em-resolv-replace
EventMachine-aware DNS lookup for Ruby.
Ruby's stock DNS resolution, by default, blocks the entire Ruby VM from processing while
the lookup is happening, because it calls out to the native libc resolver code. A slow
DNS server can cause your entire Ruby process to grind to a halt. Ruby comes with a pure
Ruby replacement that is not loaded by default:require 'resolv'
require 'resolv-replace''resolv' is the pure Ruby DNS resolver. 'resolv-replace' monkeypatches the various Ruby
Socket objects to use resolv. This gem monkeypatches the monkeypatch so that the Socket
classes will use an EventMachine-aware resolver, em-dns-resolver.== Requirements
em-resolv-replace requires Ruby 1.9.
== Installation
gem install em-resolv-replace
== Usage
Just require em-resolv-replace when initializing your application:
require 'em-resolv-replace'
The code will use the EM-aware resolver if EventMachine is running.
== Credits
em-dns-resolver.rb is taken from the em-dns project, with a connection bugfix applied by myself,
and was written by Aman Gupta and Stephan Maka.== Author
Mike Perham, @mperham, mperham AT gmail.com, http://github.com/mperham