title: Alternative for Javascript this object
body: <p>I have a simple function which routes a HTTP query pattern, queries redis and sends a response. The following is the code </p>
  
  <pre><code>router.get('/getinfo/:teamname', function main(teamname) {
  
    rclient.hgetall(teamname,function(err,obj){
          console.log("the response from redis is ",obj)
          cache.put(eventname,obj);
          console.log("inserting to cache");  
          this.res.end(obj); // this object is root cause for all problems
      });
  }
  </code></pre>
  
  <p>The router object afaik, sends the response using <code>this.res.end(obj)</code> . I guess since I am trying to do this inside my redis client , I am getting error. Is there any other way to send the value as a response ?  I thought of using emitter based model where the channel emits the response and listener gets it. but it feels like a round about way to solving this problem. Is there any simpler approach ?</p>