uysal_rockci adlı üyeden alıntı: mesajı görüntüle
Yorum için teşekkürler.
Öncelikle NodeJS'ye yeniyim, yeni yeni öğreniyorum
Bu işlem için dün linkteki örneği buldum. onu inceliyorum şimdi. settimeout ile yapmış zannedersem.

Nodejs de devamla yayın yapmak istesem yine de mantığı settimeout ile işlemi yenilemek midir acaba.

Başka alternatif yollar var mı, buna benzer işlemler için.
Hocam isin gercegi henuz async islerim icin nodejs kullanmayi denemedim. Python'da twisted yada flask ile isleri goruyoum genellikle.
Ama kodlari okuyarak size yardimci olmaya calisayim.
var pollingLoop = function () {
    
    // Make the database query
    var query = connection.query('SELECT * FROM users'),
        users = []; // this array will contain the result of our db query


    // set up the query listeners
    query
    .on('error', function(err) {
        // Handle error, and 'end' event will be emitted after this as well
        console.log( err );
        updateSockets( err );
        
    })
    .on('result', function( user ) {
        // it fills our array looping on each user row inside the db
        users.push( user );
    })
    .on('end',function(){
        // loop on itself only if there are sockets still connected
        if(connectionsArray.length) {
            pollingTimer = setTimeout( pollingLoop, POLLING_INTERVAL );

            updateSockets({users:users});
        }
    });

};
Su kisim zaten inceledigim kadariyla burda update fonks'da duzgun bicimde tanimlanmis. Hemen asagisinda da timer ile surekli calisir hale getirilmis.
Bu kodlarda bir sorun goremiyorum.