Permalink
Browse files

documented timeouts and a bump

  • Loading branch information...
1 parent 609ad3b commit ddaad9836d908e4c44e2eef50b960da89345f3f8 @substack substack committed Dec 26, 2011
Showing with 13 additions and 3 deletions.
  1. +12 −2 README.markdown
  2. +1 −1 package.json
View
@@ -221,14 +221,24 @@ var up = upnode.connect(...)
Shortcut for `upnode({}).connect(...)` like how `dnode.connect(...)` is a
shortcut for `dnode({}).connect(...)`.
-up(cb)
-------
+up(timeout=0, cb)
+-----------------
Create a new transaction from the callback `cb`.
If the connection is ready, `cb(remote, conn)` will fire immediately.
Otherwise `cb` will be queued until the connection is available again.
+If `timeout` is specified, fire `cb()` after `timeout` milliseconds with no
+arguments. Here's an example of using timeouts:
+
+``` js
+up(5000, function (remote) {
+ if (!remote) console.error('resource timed out')
+ else remote.beep()
+})
+```
+
up.close()
----------
View
@@ -1,7 +1,7 @@
{
"name" : "upnode",
"description" : "transactional connection queue for dnode",
- "version" : "0.0.1",
+ "version" : "0.1.0",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/upnode.git"

0 comments on commit ddaad98

Please sign in to comment.