NodeJS在没有客户请求的情况下发送请求

i'm newbie in nodejs and i want to send data to client without send request from client, for example i want to after create new data in database like with mysql trigger nodjs fetch data from database and send necessary data to client. in other language programing we try to create Thread to fetch such as database or send JSON object every one secode, how to this ability in NodeJS?

var server   = require('http').createServer(),
    io    = require('socket.io').listen(server),
    mysql = require('mysql'),
    express =   require('express'),
    fs    = require('fs');

server.listen(3000, 'localhost');
console.log("connected...");
var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'root',
    database: 'node'
});

io.listen(server).on('connection', function(client) {
    /* FETCH DATA IF NECESSERY AND IF DATA INSERTED IN DB OR UPDATE OR DELETE*/
    console.log("data send");

});

The rule is: When the client connects to the server, you store the identifier of the connection (for future use)
When a specific event occurs on the server side and want to transmit information to the client, fastening the stored credentials
With Socket Web, the server does not require that the client starts the communication (as long as the connection is maintained by the server and the client)

You can do as follow :

    // it can be 2 dimensional array USER_ID, SOCKET
    var STORED_SOCKET = new Array () ;

    // ...
    io.listen(server).on('connection', function (client) {
        /* FETCH DATA IF NECESSERY AND IF DATA INSERTED IN DB OR UPDATE OR DELETE*/
        STORED_SOCKET.push( client) ;
        console.log("data send");

    });

    // -- if something happend in mysql, you browse your STORED_SOCKET array, find the concerned user and send him data
    function mysqlEvent (userId, yourData) {    
        for ( i = 0 ; i < STORED_SOCKET.length ; i++ ) {
            if (STORED_SOCKET[i]['USER_ID'] == userId) {
                STORED_SOCKET[i].volatile.emit( yourData ) ;
            }
        }
    }

Hope it is clear :)