Skip to content

Commit 5e923c3

Browse files
committed
Tidy up documentation.
1 parent 789526d commit 5e923c3

File tree

3 files changed

+6
-61
lines changed

3 files changed

+6
-61
lines changed

guides/getting-started/readme.md

Lines changed: 4 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@ $ bundle add async-dns
1717
Here is a simple example showing how to use the resolver:
1818

1919
``` ruby
20-
Async do
21-
resolver = Async::DNS::System.resolver
22-
23-
addresses = resolver.addresses_for("www.google.com.")
24-
25-
puts addresses.inspect
26-
end
27-
# [#<Resolv::IPv4 202.124.127.240>, #<Resolv::IPv4 202.124.127.216>, #<Resolv::IPv4 202.124.127.223>, #<Resolv::IPv4 202.124.127.227>, #<Resolv::IPv4 202.124.127.234>, #<Resolv::IPv4 202.124.127.230>, #<Resolv::IPv4 202.124.127.208>, #<Resolv::IPv4 202.124.127.249>, #<Resolv::IPv4 202.124.127.219>, #<Resolv::IPv4 202.124.127.218>, #<Resolv::IPv4 202.124.127.212>, #<Resolv::IPv4 202.124.127.241>, #<Resolv::IPv4 202.124.127.238>, #<Resolv::IPv4 202.124.127.245>, #<Resolv::IPv4 202.124.127.251>, #<Resolv::IPv4 202.124.127.229>]
20+
resolver = Async::DNS::System.resolver
21+
22+
resolver.addresses_for("www.google.com.")
23+
# => [#<Resolv::IPv4 172.217.167.100>, #<Resolv::IPv6 2404:6800:4006:809::2004>]
2824
```
2925

3026
### Server
@@ -54,55 +50,3 @@ server.run
5450
Then to test you could use `dig` like so:
5551

5652
dig @localhost -p 5300 google.com
57-
58-
## FAQ
59-
60-
### File Handle Limitations
61-
62-
I get the error `Errno::EMFILE: Too many open files - socket(2) - udp` when trying to run a server. What should I do?
63-
64-
On some platforms (e.g. Mac OS X) the number of file descriptors is relatively low by default and should be increased by calling `ulimit -n 10000` before running tests or even before starting a server which expects a large number of concurrent incoming connections.
65-
66-
### Server
67-
68-
The performance is on the same magnitude as `bind9`. Some basic benchmarks resolving 1000 names concurrently, repeated 5 times, using `Async::DNS::Resolver` gives the following:
69-
70-
```
71-
user system total real
72-
Async::DNS::Server 4.280000 0.450000 4.730000 ( 4.854862)
73-
Bind9 4.970000 0.520000 5.490000 ( 5.541213)
74-
```
75-
76-
These benchmarks are included in the unit tests. To test bind9 performance, it must be installed and `which named` must return the executable.
77-
78-
## Performance
79-
80-
We welcome additional benchmarks and feedback regarding Async::DNS performance. To check the current performance results, consult the [travis build job output](https://travis-ci.org/socketry/async-dns).
81-
82-
### Resolver
83-
84-
The `Async::DNS::Resolver` is highly concurrent and can resolve individual names as fast as the built in `Resolv::DNS` resolver. Because the resolver is asynchronous, when dealing with multiple names, it can work more efficiently:
85-
86-
```
87-
user system total real
88-
Async::DNS::Resolver 0.020000 0.010000 0.030000 ( 0.030507)
89-
Resolv::DNS 0.070000 0.010000 0.080000 ( 1.465975)
90-
```
91-
92-
These benchmarks are included in the unit tests.
93-
94-
### Server
95-
96-
The performance is on the same magnitude as `bind9`. Some basic benchmarks resolving 1000 names concurrently, repeated 5 times, using `Async::DNS::Resolver` gives the following:
97-
98-
```
99-
user system total real
100-
Async::DNS::Server 4.280000 0.450000 4.730000 ( 4.854862)
101-
Bind9 4.970000 0.520000 5.490000 ( 5.541213)
102-
```
103-
104-
These benchmarks are included in the unit tests. To test bind9 performance, it must be installed and `which named` must return the executable.
105-
106-
### DNSSEC support
107-
108-
DNSSEC is currently not supported and is [unlikely to be supported in the future](http://sockpuppet.org/blog/2015/01/15/against-dnssec/). Feel free to submit a PR.

lib/async/dns/endpoint.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
module Async
99
module DNS
10+
# DNS endpoint helpers.
1011
module Endpoint
1112
# Get a list of standard nameserver connections which can be used for querying any standard servers that the system has been configured with.
1213
def self.for(nameservers, port: 53, **options)

lib/async/dns/resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def dispatch_query(name, resource_class)
185185
end
186186

187187
# Send the message to available servers. If no servers respond correctly, nil is returned. This result indicates a failure of the resolver to correctly contact any server and get a valid response.
188-
def dispatch_request(message, parent: Async::Task.current)
188+
def dispatch_request(message)
189189
request = Request.new(message, @endpoint)
190190
error = nil
191191

0 commit comments

Comments
 (0)