Permalink
Browse files

initial implementation

  • Loading branch information...
0 parents commit 0d32d15e99273a6712a88dab57fb48750295a144 @substack committed Jan 13, 2012
Showing with 32 additions and 0 deletions.
  1. +7 −0 README.markdown
  2. +13 −0 example/simple.js
  3. +12 −0 index.js
@@ -0,0 +1,7 @@
+toss
+====
+
+Throw away asynchronous transactions.
+
+It's like domains but without doing any core stuff, just as a function wrapper.
+
@@ -0,0 +1,13 @@
+var toss = require('../');
+var http = require('http');
+
+var t = toss();
+var to = setTimeout(function () {
+ t.end();
+}, 1000);
+
+http.get({ port : 8800, path : '/' }, t(function (res0) {
+ http.get({ port : 8800, '/beep' }, t(function (res1) {
+ t.end();
+ }));
+}));
@@ -0,0 +1,12 @@
+module.exports = function () {
+ var alive = true;
+ var self = function (fn) {
+ if (alive) fn()
+ };
+
+ self.end = function () {
+ alive = false;
+ };
+
+ return self;
+};

0 comments on commit 0d32d15

Please sign in to comment.