lib/graphite.js
function( data ) {
   
            
            var read_buffer = read_buffers_by_connection[tcp_connection];
            read_buffer += data;

            //split by new lines, 
            var messages = read_buffer.split('\n');
            
            //last element is either a partial message, or ''            
            read_buffer = messages.pop();
        
            for ( var i = 0; i < messages.length; i++ ) {
                
                //TODO error handling
                var message = messages[i];
                var components = message.split( ' ' );
                var path = components[0];
                var value = components[1];
                var timestamp = components[2];
                
                that.emit(  path, value, timestamp );                
            }            
        }
function( data ) {
   
            
            var read_buffer = read_buffers_by_connection[tcp_connection];
            read_buffer += data;

            //split by new lines, 
            var messages = read_buffer.split('\n');
            
            //last element is either a partial message, or ''            
            read_buffer = messages.pop();
        
            for ( var i = 0; i < messages.length; i++ ) {
                
                //TODO error handling
                var message = messages[i];
                var components = message.split( ' ' );
                var path = components[0];
                var value = components[1];
                var timestamp = components[2];
                
                that.emit(  path, value, timestamp );                
            }            
        }
function ( data ) { var read_buffer = read_buffers_by_connection [ tcp_connection ] ; read_buffer += data ; //split by new lines,  var messages = read_buffer . split ( '\n' ) ; //last element is either a partial message, or ''             read_buffer = messages . pop ( ) ; for ( var i = 0 ; i < messages . length ; i ++ ) { //TODO error handling var message = messages [ i ] ; var components = message . split ( ' ' ) ; var path = components [ 0 ] ; var value = components [ 1 ] ; var timestamp = components [ 2 ] ; that . emit ( path , value , timestamp ) ; } }
setup our handlers for this connection data
setup our handlers for this connection data