'custome defined'
var request = require('request');
let times = {};
module.exports = {
     setTimeOut: function(ctx,key, option, time = 1000){
//     let option = {
//       url: url,
//       method: "POST",
//       headers: {
//           "Content-Type": "application/x-www-form-urlencoded"
//       },
//       body: querystring.stringify(data)
//     }
    times[ctx.request.ip + key] = 
        setTimeout(function() {
            request(option,function(error,resp,body){
              console.log("--CallBack---success!!!---");
            });    
        }, option.time);
    },
    clearTimeOut: function(ctx,key){
        clearTimeout(times[ctx.request.ip + key])
    }
}