I solved as the below code by using setTimeout function. I know that is not the great answer but now can solved my error indeed.
getAllDatas = function(fn){
var _datas = [];
client.smembers('db:contact:all', function(err, _uid){
if(err)
throw err;
else{
for(var i = 0; i < _uid.length; i++){
client.hgetall('db:contact:' + _uid[i], function(err, reply){
if(err)
throw err;
else{
_datas.push(reply);
}
});
}
}
});
setTimeout(function(){
fn(_datas);
}, 100);
};