title: Synchronous call to Redis Server
body: <p>With the following code, I access the Redis client asynchronously, with a casual Node JS way to code:</p>
  <pre><code>function start()
  {
      var redis = require(&quot;redis&quot;);
      var host = &quot;127.0.0.1&quot;;
      var port = 6379;
      var client = redis.createClient(port, host);    
      
      client.on(&quot;error&quot;, function (err) {
          console.log(&quot;Error &quot; + err);
      });
  
      client.set(&quot;hi&quot;, &quot;hey&quot;, redis.print);
  
      return client;
  }
  
  function getValue(client, callback)
  {
      client.get(&quot;hi&quot;, function (err, res) {
          callback(res);
      });
  
  }
  
  var c = start();
  getValue(c, function(r){
      console.log('Result ' + r);
  });
  </code></pre>
  <p>And the console prints 'Result hey'.</p>
  <p>Instead of using a callback in the getValue() function, I would like to make a classical return:</p>
  <pre><code>function getValue(client)
  {
      client.get(&quot;hi&quot;, function (err, res) {
          return res;
      });
  
  }
  </code></pre>
  <p>in order to have:</p>
  <pre><code>var r = getValue(c);
  console.log(r);
  </code></pre>
  <p>So to make a synchronous call to the Redis server. I've tried async, fibrous, ... library but I'm stuck and cannot find out how to do that.</p>