function visitFollowed(visitor, startKey, paged) {  
    var deferred = $.Deferred();
    var request = _(requestTemplate).clone();
    request.limit = 25;
    if (startKey) {
      request.start_key = String(startKey);
    }
    
    // Dispatches a single query to the server.  
    function sendQuery() {
      serviceRequest('query_followed', request).done(doneQuery).fail(failQuery);
    }
    
    // Invokes the callback with the result of a completed query.  If there are 
    // more results on the server which were paged, creates a continuation function
    // which will query the next page and returns it.
    function doneQuery(response) {
      _(response.viewpoints).each(visitor);
      
      if (response.viewpoints.length >= request.limit) {
        if (paged) {
          deferred.resolve(response.last_key);
        } else {
          request.start_key = response.last_key;
          sendQuery();
        }
      } else {
        deferred.resolve();
      }
    }
    
    function failQuery(jqHxr, textStatus) {
      deferred.reject("Error from visitfollowed: " + textStatus);
    }
    
    sendQuery();
    return deferred;
  }
/**
   * Queries the service for a list of viewpoints followed by the current user and
   * invokes the visitor function once for each viewpoint.  Paging is handled
   * transparently by this function.
   *
   * @memberof viewfinder.query
   * @param {Function} vistor Visitor function which will be invoked once for each viewpoint
   *  followed by the current user.
   * @param {String} startKey Optional starting key for the first viewpoint query.
   * @param {Boolean} paged If true, visitFollowed will only query the server a single time.  If there
   *  are still viewpoints remaining after the initial query, the deferred will be resolved with the
   *  last key returned by that query.  This allows for explicit control of paging.
   * 
   * @returns {jQuery.Deferred} A jQuery deferred object which will resolve when all followed viewpoints 
   *  have been visited.
   */
Queries the service for a list of viewpoints followed by the current user and
invokes the visitor function once for each viewpoint.  Paging is handled
transparently by this function.

@memberof viewfinder.query
@param {Function} vistor Visitor function which will be invoked once for each viewpoint
followed by the current user.
@param {String} startKey Optional starting key for the first viewpoint query.
@param {Boolean} paged If true, visitFollowed will only query the server a single time.  If there
are still viewpoints remaining after the initial query, the deferred will be resolved with the
last key returned by that query.  This allows for explicit control of paging.

@returns {jQuery.Deferred} A jQuery deferred object which will resolve when all followed viewpoints
have been visited.
Queries the service for a list of viewpoints followed by the current user and invokes the visitor function once for each viewpoint . Paging is handled transparently by this function . @memberof viewfinder . query @param { Function } vistor Visitor function which will be invoked once for each viewpoint followed by the current user . @param { String } startKey Optional starting key for the first viewpoint query . @param { Boolean } paged If true visitFollowed will only query the server a single time . If there are still viewpoints remaining after the initial query the deferred will be resolved with the last key returned by that query . This allows for explicit control of paging . @returns { jQuery . Deferred } A jQuery deferred object which will resolve when all followed viewpoints have been visited .
function visitFollowed(visitor, startKey, paged) {  
    var deferred = $.Deferred();
    var request = _(requestTemplate).clone();
    request.limit = 25;
    if (startKey) {
      request.start_key = String(startKey);
    }
    function sendQuery() {
      serviceRequest('query_followed', request).done(doneQuery).fail(failQuery);
    }
    function doneQuery(response) {
      _(response.viewpoints).each(visitor);
      if (response.viewpoints.length >= request.limit) {
        if (paged) {
          deferred.resolve(response.last_key);
        } else {
          request.start_key = response.last_key;
          sendQuery();
        }
      } else {
        deferred.resolve();
      }
    }
    function failQuery(jqHxr, textStatus) {
      deferred.reject("Error from visitfollowed: " + textStatus);
    }
    sendQuery();
    return deferred;
  }
function visitFollowed ( visitor , startKey , paged ) { var deferred = $ . Deferred ( ) ; var request = _ ( requestTemplate ) . clone ( ) ; request . limit = 25 ; if ( startKey ) { request . start_key = String ( startKey ) ; } function sendQuery ( ) { serviceRequest ( 'query_followed' , request ) . done ( doneQuery ) . fail ( failQuery ) ; } function doneQuery ( response ) { _ ( response . viewpoints ) . each ( visitor ) ; if ( response . viewpoints . length >= request . limit ) { if ( paged ) { deferred . resolve ( response . last_key ) ; } else { request . start_key = response . last_key ; sendQuery ( ) ; } } else { deferred . resolve ( ) ; } } function failQuery ( jqHxr , textStatus ) { deferred . reject ( "Error from visitfollowed: " + textStatus ) ; } sendQuery ( ) ; return deferred ; }
Queries the service for a list of viewpoints followed by the current user and
 invokes the visitor function once for each viewpoint.
Queries the service for a list of viewpoints followed by the current user and invokes the visitor function once for each viewpoint .
// Dispatches a single query to the server.   // Invokes the callback with the result of a completed query.  If there are  // more results on the server which were paged, creates a continuation function // which will query the next page and returns it.