rschmukler/agenda

View on GitHub
docs/agenda/4.2.0/Agenda.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>
      Agenda - Documentation
  </title>

  <link href="https://www.braintreepayments.com/images/favicon-ccda0b14.png" rel="icon" type="image/png">

  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>

  <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  

  

  <!-- start Mixpanel -->
  <script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
  0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
  for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
  mixpanel.init("1919205b2da72e4da3b9b6639b444d59");</script>
  <!-- end Mixpanel -->
</head>

<body>
  <svg style="display: none;">
    <defs>
      <symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
          <path d="M0 0h24v24H0z" fill="none"/>
          <path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
      </symbol>
    </defs>
  </svg>

  <input type="checkbox" id="nav-trigger" class="nav-trigger" />
  <label for="nav-trigger" class="navicon-button x">
    <div class="navicon"></div>
  </label>

  <label for="nav-trigger" class="overlay"></label>

  <div class="top-nav-wrapper">
    <ul>
      <li >
        <a href="index.html">
          
            <svg fill="#6D6D6D" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
              <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
              <path d="M0 0h24v24H0z" fill="none"/>
            </svg>
          
          
        </a>
      </li>

      

    </ul>
  </div>

  <nav>
    <h3 class="reference-title">
      Agenda
    </h3>

    

    <h3>Classes</h3><ul><li id="Agenda-nav"><a href="Agenda.html">Agenda</a><ul class='methods'><li data-type="method" id="Agenda-cancel-nav"><a href="Agenda.html#cancel">cancel</a></li><li data-type="method" id="Agenda-cancel-nav"><a href="Agenda.html#cancel">cancel</a></li><li data-type="method" id="Agenda-close-nav"><a href="Agenda.html#close">close</a></li><li data-type="method" id="Agenda-close-nav"><a href="Agenda.html#close">close</a></li><li data-type="method" id="Agenda-create-nav"><a href="Agenda.html#create">create</a></li><li data-type="method" id="Agenda-create-nav"><a href="Agenda.html#create">create</a></li><li data-type="method" id="Agenda-database-nav"><a href="Agenda.html#database">database</a></li><li data-type="method" id="Agenda-database-nav"><a href="Agenda.html#database">database</a></li><li data-type="method" id="Agenda-dbInit-nav"><a href="Agenda.html#dbInit">dbInit</a></li><li data-type="method" id="Agenda-dbInit-nav"><a href="Agenda.html#dbInit">dbInit</a></li><li data-type="method" id="Agenda-defaultConcurrency-nav"><a href="Agenda.html#defaultConcurrency">defaultConcurrency</a></li><li data-type="method" id="Agenda-defaultConcurrency-nav"><a href="Agenda.html#defaultConcurrency">defaultConcurrency</a></li><li data-type="method" id="Agenda-defaultLockLifetime-nav"><a href="Agenda.html#defaultLockLifetime">defaultLockLifetime</a></li><li data-type="method" id="Agenda-defaultLockLifetime-nav"><a href="Agenda.html#defaultLockLifetime">defaultLockLifetime</a></li><li data-type="method" id="Agenda-defaultLockLimit-nav"><a href="Agenda.html#defaultLockLimit">defaultLockLimit</a></li><li data-type="method" id="Agenda-defaultLockLimit-nav"><a href="Agenda.html#defaultLockLimit">defaultLockLimit</a></li><li data-type="method" id="Agenda-define-nav"><a href="Agenda.html#define">define</a></li><li data-type="method" id="Agenda-define-nav"><a href="Agenda.html#define">define</a></li><li data-type="method" id="Agenda-disable-nav"><a href="Agenda.html#disable">disable</a></li><li data-type="method" id="Agenda-disable-nav"><a href="Agenda.html#disable">disable</a></li><li data-type="method" id="Agenda-enable-nav"><a href="Agenda.html#enable">enable</a></li><li data-type="method" id="Agenda-enable-nav"><a href="Agenda.html#enable">enable</a></li><li data-type="method" id="Agenda-every-nav"><a href="Agenda.html#every">every</a></li><li data-type="method" id="Agenda-every-nav"><a href="Agenda.html#every">every</a></li><li data-type="method" id="Agenda-findAndLockNextJob-nav"><a href="Agenda.html#findAndLockNextJob">findAndLockNextJob</a></li><li data-type="method" id="Agenda-findAndLockNextJob-nav"><a href="Agenda.html#findAndLockNextJob">findAndLockNextJob</a></li><li data-type="method" id="Agenda-jobs-nav"><a href="Agenda.html#jobs">jobs</a></li><li data-type="method" id="Agenda-jobs-nav"><a href="Agenda.html#jobs">jobs</a></li><li data-type="method" id="Agenda-locklimit-nav"><a href="Agenda.html#locklimit">locklimit</a></li><li data-type="method" id="Agenda-locklimit-nav"><a href="Agenda.html#locklimit">locklimit</a></li><li data-type="method" id="Agenda-maxConcurrency-nav"><a href="Agenda.html#maxConcurrency">maxConcurrency</a></li><li data-type="method" id="Agenda-maxConcurrency-nav"><a href="Agenda.html#maxConcurrency">maxConcurrency</a></li><li data-type="method" id="Agenda-mongo-nav"><a href="Agenda.html#mongo">mongo</a></li><li data-type="method" id="Agenda-mongo-nav"><a href="Agenda.html#mongo">mongo</a></li><li data-type="method" id="Agenda-name-nav"><a href="Agenda.html#name">name</a></li><li data-type="method" id="Agenda-name-nav"><a href="Agenda.html#name">name</a></li><li data-type="method" id="Agenda-now-nav"><a href="Agenda.html#now">now</a></li><li data-type="method" id="Agenda-now-nav"><a href="Agenda.html#now">now</a></li><li data-type="method" id="Agenda-processEvery-nav"><a href="Agenda.html#processEvery">processEvery</a></li><li data-type="method" id="Agenda-processEvery-nav"><a href="Agenda.html#processEvery">processEvery</a></li><li data-type="method" id="Agenda-purge-nav"><a href="Agenda.html#purge">purge</a></li><li data-type="method" id="Agenda-purge-nav"><a href="Agenda.html#purge">purge</a></li><li data-type="method" id="Agenda-saveJob-nav"><a href="Agenda.html#saveJob">saveJob</a></li><li data-type="method" id="Agenda-saveJob-nav"><a href="Agenda.html#saveJob">saveJob</a></li><li data-type="method" id="Agenda-sort-nav"><a href="Agenda.html#sort">sort</a></li><li data-type="method" id="Agenda-sort-nav"><a href="Agenda.html#sort">sort</a></li><li data-type="method" id="Agenda-start-nav"><a href="Agenda.html#start">start</a></li><li data-type="method" id="Agenda-start-nav"><a href="Agenda.html#start">start</a></li><li data-type="method" id="Agenda-stop-nav"><a href="Agenda.html#stop">stop</a></li><li data-type="method" id="Agenda-stop-nav"><a href="Agenda.html#stop">stop</a></li></ul></li><li id="Job-nav"><a href="Job.html">Job</a><ul class='methods'><li data-type="method" id="Job-computeNextRunAt-nav"><a href="Job.html#computeNextRunAt">computeNextRunAt</a></li><li data-type="method" id="Job-computeNextRunAt-nav"><a href="Job.html#computeNextRunAt">computeNextRunAt</a></li><li data-type="method" id="Job-disable-nav"><a href="Job.html#disable">disable</a></li><li data-type="method" id="Job-disable-nav"><a href="Job.html#disable">disable</a></li><li data-type="method" id="Job-enable-nav"><a href="Job.html#enable">enable</a></li><li data-type="method" id="Job-enable-nav"><a href="Job.html#enable">enable</a></li><li data-type="method" id="Job-fail-nav"><a href="Job.html#fail">fail</a></li><li data-type="method" id="Job-fail-nav"><a href="Job.html#fail">fail</a></li><li data-type="method" id="Job-isRunning-nav"><a href="Job.html#isRunning">isRunning</a></li><li data-type="method" id="Job-isRunning-nav"><a href="Job.html#isRunning">isRunning</a></li><li data-type="method" id="Job-remove-nav"><a href="Job.html#remove">remove</a></li><li data-type="method" id="Job-remove-nav"><a href="Job.html#remove">remove</a></li><li data-type="method" id="Job-repeatAt-nav"><a href="Job.html#repeatAt">repeatAt</a></li><li data-type="method" id="Job-repeatAt-nav"><a href="Job.html#repeatAt">repeatAt</a></li><li data-type="method" id="Job-repeatEvery-nav"><a href="Job.html#repeatEvery">repeatEvery</a></li><li data-type="method" id="Job-repeatEvery-nav"><a href="Job.html#repeatEvery">repeatEvery</a></li><li data-type="method" id="Job-run-nav"><a href="Job.html#run">run</a></li><li data-type="method" id="Job-run-nav"><a href="Job.html#run">run</a></li><li data-type="method" id="Job-schedule-nav"><a href="Job.html#schedule">schedule</a></li><li data-type="method" id="Job-schedule-nav"><a href="Job.html#schedule">schedule</a></li><li data-type="method" id="Job-toJSON-nav"><a href="Job.html#toJSON">toJSON</a></li><li data-type="method" id="Job-toJSON-nav"><a href="Job.html#toJSON">toJSON</a></li><li data-type="method" id="Job-touch-nav"><a href="Job.html#touch">touch</a></li><li data-type="method" id="Job-touch-nav"><a href="Job.html#touch">touch</a></li><li data-type="method" id="Job-unique-nav"><a href="Job.html#unique">unique</a></li><li data-type="method" id="Job-unique-nav"><a href="Job.html#unique">unique</a></li></ul></li><li id="JobProcessingQueue-nav"><a href="JobProcessingQueue.html">JobProcessingQueue</a><ul class='methods'><li data-type="method" id="JobProcessingQueue-insert-nav"><a href="JobProcessingQueue.html#insert">insert</a></li><li data-type="method" id="JobProcessingQueue-insert-nav"><a href="JobProcessingQueue.html#insert">insert</a></li><li data-type="method" id="JobProcessingQueue-pop-nav"><a href="JobProcessingQueue.html#pop">pop</a></li><li data-type="method" id="JobProcessingQueue-pop-nav"><a href="JobProcessingQueue.html#pop">pop</a></li><li data-type="method" id="JobProcessingQueue-push-nav"><a href="JobProcessingQueue.html#push">push</a></li><li data-type="method" id="JobProcessingQueue-push-nav"><a href="JobProcessingQueue.html#push">push</a></li><li data-type="method" id="JobProcessingQueue-returnNextConcurrencyFreeJob-nav"><a href="JobProcessingQueue.html#returnNextConcurrencyFreeJob">returnNextConcurrencyFreeJob</a></li><li data-type="method" id="JobProcessingQueue-returnNextConcurrencyFreeJob-nav"><a href="JobProcessingQueue.html#returnNextConcurrencyFreeJob">returnNextConcurrencyFreeJob</a></li></ul></li></ul><h3 id="global-nav">Global</h3><ul><li><a href="global.html#createJob">createJob</a></li><li><a href="global.html#hasMongoProtocol">hasMongoProtocol</a></li><li><a href="global.html#parsePriority">parsePriority</a></li><li><a href="global.html#priority">priority</a></li><li><a href="global.html#processJobs">processJobs</a></li></ul>
  </nav>

  <div id="main">
    
      <h1 class="page-title">
        Agenda
      </h1>
    

    

<section>
  <header>
    
      <h2>
        
        Agenda
        
      </h2>

      
    
  </header>

  <article>
    <div class="container-overview">
      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#Agenda">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="Agenda">
      <span class="type-signature"></span>new Agenda<span class="signature">(config, cb)</span><span class="type-signature"></span>
    </h4>
  </span>

  









  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>config</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Agenda Config</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      function
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Callback after Agenda has started and connected to mongo</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





  <h5 class="subsection-title">Properties:</h5>

  

<table class="props">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    

    <tr>
      
        <td class="name"><code>_name</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          <p>Name of the current Agenda queue</p>
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_processEvery</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_defaultConcurrency</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_maxConcurrency</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_defaultLockLimit</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_lockLimit</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_definitions</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_runningJobs</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_lockedJobs</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_jobQueue</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_defaultLockLifetime</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_sort</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_indices</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_isLockingOnTheFly</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Boolean
    </span>

    


        
      </td>

        

        

        <td class="description last">
          <p>true if 'lockingOnTheFly' is currently running. Prevent concurrent execution of this method.</p>
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_isJobQueueFilling</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Map
    </span>

    


        
      </td>

        

        

        <td class="description last">
          <p>A map of jobQueues and if the 'jobQueueFilling' method is currently running for a given map. 'lockingOnTheFly' and 'jobQueueFilling' should not run concurrently for the same jobQueue. It can cause that lock limits aren't honored.</p>
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_jobsToLock</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Array
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  
  </tbody>
</table>




<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_index.js.html">agenda/index.js</a>, <a href="agenda_index.js.html#line36">line 36</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    </div>

    

    

    

     

    

    

    
      <h3 class="subsection-title">Methods</h3>

      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    

    

    
  </article>
</section>




<section>
  <header>
    
      <h2>
        
        Agenda
        
      </h2>

      
    
  </header>

  <article>
    <div class="container-overview">
      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#Agenda">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="Agenda">
      <span class="type-signature"></span>new Agenda<span class="signature">(config, cb)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Constructs a new Agenda object.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>config</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>Optional configuration to initialize the Agenda.</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>Optional callback called with the MongoDB collection.</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_index.js.html">agenda/index.js</a>, <a href="agenda_index.js.html#line63">line 63</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    </div>

    

    

    

     

    

    

    
      <h3 class="subsection-title">Methods</h3>

      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    

    

    
  </article>
</section>




<section>
  <header>
    
      <h2>
        
        Agenda
        
      </h2>

      
    
  </header>

  <article>
    <div class="container-overview">
      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#Agenda">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="Agenda">
      <span class="type-signature"></span>new Agenda<span class="signature">(config, cb)</span><span class="type-signature"></span>
    </h4>
  </span>

  









  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>config</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Agenda Config</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      function
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Callback after Agenda has started and connected to mongo</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





  <h5 class="subsection-title">Properties:</h5>

  

<table class="props">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    

    <tr>
      
        <td class="name"><code>_name</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          <p>Name of the current Agenda queue</p>
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_processEvery</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_defaultConcurrency</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_maxConcurrency</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_defaultLockLimit</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_lockLimit</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_definitions</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_runningJobs</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_lockedJobs</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_jobQueue</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_defaultLockLifetime</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Number
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_sort</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_indices</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Object
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_isLockingOnTheFly</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Boolean
    </span>

    


        
      </td>

        

        

        <td class="description last">
          <p>true if 'lockingOnTheFly' is currently running. Prevent concurrent execution of this method.</p>
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_isJobQueueFilling</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Map
    </span>

    


        
      </td>

        

        

        <td class="description last">
          <p>A map of jobQueues and if the 'jobQueueFilling' method is currently running for a given map. 'lockingOnTheFly' and 'jobQueueFilling' should not run concurrently for the same jobQueue. It can cause that lock limits aren't honored.</p>
          </td>
    </tr>

  

    <tr>
      
        <td class="name"><code>_jobsToLock</code></td>
      

      <td class="type">
        
          
    <span class="param-type">
      Array
    </span>

    


        
      </td>

        

        

        <td class="description last">
          
          </td>
    </tr>

  
  </tbody>
</table>




<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_index.js.html">agenda/index.js</a>, <a href="agenda_index.js.html#line36">line 36</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    </div>

    

    

    

     

    

    

    
      <h3 class="subsection-title">Methods</h3>

      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    

    

    
  </article>
</section>




<section>
  <header>
    
      <h2>
        
        Agenda
        
      </h2>

      
    
  </header>

  <article>
    <div class="container-overview">
      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#Agenda">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="Agenda">
      <span class="type-signature"></span>new Agenda<span class="signature">(config, cb)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Constructs a new Agenda object.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>config</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>Optional configuration to initialize the Agenda.</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>Optional callback called with the MongoDB collection.</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_index.js.html">agenda/index.js</a>, <a href="agenda_index.js.html#line63">line 63</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    </div>

    

    

    

     

    

    

    
      <h3 class="subsection-title">Methods</h3>

      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#cancel">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="cancel">
      <span class="type-signature"></span>cancel<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Cancels any jobs matching the passed MongoDB query, and removes them from the database.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when cancelling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_cancel.js.html">agenda/cancel.js</a>, <a href="agenda_cancel.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#close">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="close">
      <span class="type-signature"></span>close<span class="signature">(option<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Close the db and it's underlying connections
Only works if agenda was instantiated without preconfigured mongoDb instance.
If the mongoDb instance was supplied during instantiation or via agenda.mongo, this function will do nothing and return agenda anyway.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>option</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Object
    </span>

    


          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>Force close, emitting no events</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_close.js.html">agenda/close.js</a>, <a href="agenda_close.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#create">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="create">
      <span class="type-signature"></span>create<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Given a name and some data, create a new job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to set for job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_create.js.html">agenda/create.js</a>, <a href="agenda_create.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#database">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="database">
      <span class="type-signature"></span>database<span class="signature">(url, collection<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Connect to the spec'd MongoDB server and database.</p>
<p>NOTE:
If <code>url</code> includes auth details then <code>options</code> must specify: { 'uri_decode_auth': true }. This does Auth on
the specified database, not the Admin database. If you are using Auth on the Admin DB and not on the Agenda DB,
then you need to authenticate against the Admin DB and then pass the MongoDB instance into the constructor
or use Agenda.mongo(). If your app already has a MongoDB connection then use that. ie. specify config.mongo in
the constructor or use Agenda.mongo().</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>url</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>MongoDB server URI</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of collection to use. Defaults to <code>agendaJobs</code></p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for connecting</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>callback of MongoDB connection</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_database.js.html">agenda/database.js</a>, <a href="agenda_database.js.html#line11">line 11</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#dbInit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="dbInit">
      <span class="type-signature"></span>dbInit<span class="signature">(collection, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup and initialize the collection used to manage Jobs.</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name or undefined for default 'agendaJobs'</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when the db is initialized</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_db-init.js.html">agenda/db-init.js</a>, <a href="agenda_db-init.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultConcurrency">
      <span class="type-signature"></span>defaultConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default concurrency for each job</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>default concurrency</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-concurrency.js.html">agenda/default-concurrency.js</a>, <a href="agenda_default-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLifetime">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLifetime">
      <span class="type-signature"></span>defaultLockLifetime<span class="signature">(ms)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default lock time (in ms)
Default is 10 * 60 * 1000 ms (10 minutes)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>ms</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>time in ms to set default lock</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-lifetime.js.html">agenda/default-lock-lifetime.js</a>, <a href="agenda_default-lock-lifetime.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#defaultLockLimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="defaultLockLimit">
      <span class="type-signature"></span>defaultLockLimit<span class="signature">(num)</span><span class="type-signature"> &rarr; {<a href="Agenda.html">Agenda</a>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set default lock limit per job type</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>num</code></td>
        

        <td class="type">
          
            
    <span class="param-type">
      Number
    </span>

    


          
        </td>

        

        

        <td class="description last">
          <p>Lock limit per job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_default-lock-limit.js.html">agenda/default-lock-limit.js</a>, <a href="agenda_default-lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#define">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="define">
      <span class="type-signature"></span>define<span class="signature">(name, options, processor<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Setup definition for job
Method is used by consumers of lib to setup their functions</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name of job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>options for job to run</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>processor</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>function to be called to run actual job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_define.js.html">agenda/define.js</a>, <a href="agenda_define.js.html#line17">line 17</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#disable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="disable">
      <span class="type-signature"></span>disable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Disables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>true</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_disable.js.html">agenda/disable.js</a>, <a href="agenda_disable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#enable">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="enable">
      <span class="type-signature"></span>enable<span class="signature">(query)</span><span class="type-signature"> &rarr; {Promise.&lt;Number>}</span>
    </h4>
  </span>

  



  <div class="description">
    <p>Enables any jobs matching the passed MongoDB query by setting the <code>disabled</code> flag to <code>false</code></p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>MongoDB query to use when enabling</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_enable.js.html">agenda/enable.js</a>, <a href="agenda_enable.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#every">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="every">
      <span class="type-signature"></span>every<span class="signature">(interval, names, data, options)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Creates a scheduled job with given interval and name/names of the job to run</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>interval</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>run every X interval</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>names</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>String or strings of jobs to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to run for job</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>options</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>options to run job for</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_every.js.html">agenda/every.js</a>, <a href="agenda_every.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#findAndLockNextJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="findAndLockNextJob">
      <span class="type-signature">(protected) </span>findAndLockNextJob<span class="signature">(jobName, definition)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Find and lock jobs</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>jobName</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to try to lock</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>definition</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>definition used to tell how job is run</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_find-and-lock-next-job.js.html">agenda/find-and-lock-next-job.js</a>, <a href="agenda_find-and-lock-next-job.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#jobs">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="jobs">
      <span class="type-signature"></span>jobs<span class="signature">(query<span class="signature-attributes">opt</span>, sort<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, number<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Finds all jobs matching 'query'</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>sort</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>object for MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>number of documents to return from MongoDB</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>number</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>of documents to skip in MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_jobs.js.html">agenda/jobs.js</a>, <a href="agenda_jobs.js.html#line14">line 14</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#locklimit">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="locklimit">
      <span class="type-signature"></span>locklimit<span class="signature">(limit)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default amount jobs that are allowed to be locked at one time (GLOBAL)</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>limit</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>num Lock limit</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_lock-limit.js.html">agenda/lock-limit.js</a>, <a href="agenda_lock-limit.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#maxConcurrency">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="maxConcurrency">
      <span class="type-signature"></span>maxConcurrency<span class="signature">(concurrency)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the concurrency for jobs (globally), type does not matter</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>concurrency</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>max concurrency value</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_max-concurrency.js.html">agenda/max-concurrency.js</a>, <a href="agenda_max-concurrency.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#mongo">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="mongo">
      <span class="type-signature"></span>mongo<span class="signature">(mdb, collection<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Build method used to add MongoDB connection details</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      
        <th>Attributes</th>
      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>mdb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            

            

            
          </td>
        

        

        <td class="description last">
          <p>instance of MongoClient to use</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>collection</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>name collection we want to use ('agendaJobs')</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>cb</code></td>
        

        <td class="type">
          
        </td>

        
          <td class="attributes">
            
              &lt;optional><br>
            

            

            
          </td>
        

        

        <td class="description last">
          <p>called when MongoDB connection fails or passes</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_mongo.js.html">agenda/mongo.js</a>, <a href="agenda_mongo.js.html#line4">line 4</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#name">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="name">
      <span class="type-signature"></span>name<span class="signature">(name)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set name of queue</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of agenda instance</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_name.js.html">agenda/name.js</a>, <a href="agenda_name.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#now">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="now">
      <span class="type-signature"></span>now<span class="signature">(name, data)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Create a job for this exact moment</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>name</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>name of job to schedule</p>
          
        </td>
      </tr>

    
      <tr>
        
          <td class="name"><code>data</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>data to pass to job</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_now.js.html">agenda/now.js</a>, <a href="agenda_now.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#processEvery">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="processEvery">
      <span class="type-signature"></span>processEvery<span class="signature">(time)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the default process interval</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>time</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>time to process, expressed in human interval</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_process-every.js.html">agenda/process-every.js</a>, <a href="agenda_process-every.js.html#line10">line 10</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#purge">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="purge">
      <span class="type-signature"></span>purge<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Removes all jobs from queue</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_purge.js.html">agenda/purge.js</a>, <a href="agenda_purge.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#saveJob">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="saveJob">
      <span class="type-signature"></span>saveJob<span class="signature">(job)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Save the properties on a job to MongoDB</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>job</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>job to save into MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_save-job.js.html">agenda/save-job.js</a>, <a href="agenda_save-job.js.html#line64">line 64</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#sort">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="sort">
      <span class="type-signature"></span>sort<span class="signature">(query)</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Set the sort query for finding next job
Default is { nextRunAt: 1, priority: -1 }</p>
  </div>







  <h5>Parameters:</h5>
  

<table class="params">
  <thead>
    <tr>
      
        <th>Name</th>
      

      <th>Type</th>

      

      

      <th class="last">Description</th>
    </tr>
  </thead>

  <tbody>
    
      <tr>
        
          <td class="name"><code>query</code></td>
        

        <td class="type">
          
        </td>

        

        

        <td class="description last">
          <p>sort query object for MongoDB</p>
          
        </td>
      </tr>

    
  </tbody>
</table>





<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_sort.js.html">agenda/sort.js</a>, <a href="agenda_sort.js.html#line9">line 9</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#start">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="start">
      <span class="type-signature"></span>start<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Starts processing jobs using processJobs() methods, storing an interval ID
This method will only resolve if a db has been set up beforehand.</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_start.js.html">agenda/start.js</a>, <a href="agenda_start.js.html#line19">line 19</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
        


  

  <span class='name-container'>
    <a class="link-icon" href="#stop">
      <svg height="20" width="20" style="fill: black;">
        <use xlink:href="#linkIcon"></use>
      </svg>
    </a>
    <h4 class="name" id="stop">
      <span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span>
    </h4>
  </span>

  



  <div class="description">
    <p>Clear the interval that processes the jobs</p>
  </div>










<dl class="details">

  

  

  

  

  

  

  

  

  

  

  

  

  
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
      <ul class="dummy">
        <li>
          <a href="agenda_stop.js.html">agenda/stop.js</a>, <a href="agenda_stop.js.html#line18">line 18</a>
        </li>
      </ul>
    </dd>
  

  

  

  
</dl>














      
    

    

    
  </article>
</section>




  </div>

  <br class="clear">

  <footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a>
  </footer>

  <script src="scripts/linenumber.js"></script>
  <script src="scripts/pagelocation.js"></script>

  

</body>
</html>