Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

some documenation

  • Loading branch information...
commit 8f686559dc2ca3fc77d4a4c57cfdb71f90bb950b 1 parent 5a1abab
@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)
Please sign in to comment.
Something went wrong with that request. Please try again.