Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

some documenation

  • Loading branch information...
commit 00b95c34b39d58318bdfddd7d84d71d315573963 1 parent 1aba957
@maxtaco authored
Showing with 34 additions and 0 deletions.
  1. +17 −0 examples/tame/dns.coffee
  2. +17 −0 examples/tame/dns_serial.coffee
View
17 examples/tame/dns.coffee
@@ -0,0 +1,17 @@
+
+dns = require("dns");
+
+do_one = (cb, host) ->
+ await dns.resolve host, "A", defer(err, ip)
+ if err
+ console.log "ERROR! " + err
+ else
+ console.log host + " -> " + ip
+ cb()
+
+do_all = (lst) ->
+ await
+ for h in lst
+ do_one defer(), h
+
+do_all process.argv.slice(2)
View
17 examples/tame/dns_serial.coffee
@@ -0,0 +1,17 @@
+
+dns = require("dns");
+
+do_one = (cb, host) ->
+ await dns.resolve host, "A", defer(err, ip)
+ if err
+ console.log "ERROR! " + err
+ else
+ console.log host + " -> " + ip
+ cb()
+
+do_all = (lst) ->
+ for h in lst
+ await
+ do_one defer(), h
+
+do_all process.argv.slice(2)

0 comments on commit 00b95c3

Please sign in to comment.
Something went wrong with that request. Please try again.