process.on('message', function(data) {
    try{
        var source = data.source;
        var funcs = require('./'+source.src+'.js');
        var params = data.params,result;
        if( data.sync ){
            result = funcs[source.func].apply(null,params);
            process.send(result);
        }else{
            function cb(rt){
                process.send(rt);
            }
            params.push(cb);
            funcs[source.func].apply(null,params);
        }
    }catch(e){
        process.send({success:0,msg:e.message});
    }
});