code: function(callback) {
      var instance = this;
      if (!isFunction(callback)) {
          return callback;
      }
      return function asyncCallback() {
          if (asyncCallback.immediately) {
              // The API already returned, we can invoke the callback immediately.
              callback.apply(instance, arguments);
          } else {
              var args = arguments;
              process.nextTick(function() {
                  callback.apply(instance, args);
              });
          }
      };
  }
docs: c-ares invokes a callback either synchronously or asynchronously, but the dns API should always invoke a callback asynchronously.  This function makes sure that the callback is invoked asynchronously. It returns a function that invokes the callback within nextTick().  To avoid invoking unnecessary nextTick(), `immediately` property of returned function should be set to true after c-ares returned.  Usage:  function someAPI(callback) { callback = makeAsync(callback); channel.someAPI(..., callback); callback.immediately = true; }