var net               = require("net");
var Scuttlebutt       = require("scuttlebutt/model");
var timing            = new Scuttlebutt();
var socket            = "/tmp/rauschen.sock";
var processGeoData   = require("./lib/geoip.js");
var processUserAgent= require("./lib/user-agent-detector.js");

var timingStream = timing.createStream();

timingStream.pipe(net.connect(socket)).pipe(timingStream);

timing.on("update", function(key){
    var data = timing.data;
    async.parallel({
        geo: function(){
            geoDataProvider(data.remoteAddress, function(geoData){
                data.geo = geoData;
            });
        },
        userAgent: function(){
            userAgentDetector(data.userAgent, function(userAgentData){
                data.userAgentData = userAgentData;
            });
        }
    },
    function(){
        console.log('done');
    });
});




@@ -29,24 +29,66 @@
 ire(%22net%22);%0A
+var async             = require(%22async%22);%0A
 var Scuttleb
@@ -478,17 +478,23 @@
     var 
-d
+timingD
 ata = ti
@@ -502,13 +502,77 @@
 ing.
-data;
+get(key);%0A    process(timingData);%0A%7D);%0A%0Avar process = function(data)%7B
 %0A   
@@ -603,32 +603,34 @@
   geo: function(
+cb
 )%7B%0A            g
@@ -632,23 +632,22 @@
     
-geoDataProvider
+processGeoData
 (dat
@@ -672,16 +672,21 @@
 unction(
+err, 
 geoData)
@@ -719,24 +719,46 @@
  = geoData;%0A
+                cb();%0A
             
@@ -781,24 +781,17 @@
        u
-serAgent
+a
 : functi
@@ -785,32 +785,34 @@
    ua: function(
+cb
 )%7B%0A            u
@@ -814,25 +814,24 @@
     
-userAgentDetector
+processUserAgent
 (dat
@@ -852,16 +852,21 @@
 unction(
+err, 
 userAgen
@@ -921,24 +921,46 @@
 rAgentData;%0A
+                cb();%0A
             
@@ -979,20 +979,16 @@
 %7D%0A    %7D,
-%0A   
  functio
@@ -989,16 +989,27 @@
 unction(
+err, result
 )%7B%0A     
@@ -1023,18 +1023,16 @@
 ole.
-log('done'
+dir(data
 );%0A 
@@ -1039,14 +1039,13 @@
    %7D);%0A%7D
-)
 ;%0A%0A%0A%0A

fix async processing