title: Sails.js background processing loop, not related to connections
body: <p>If you have a process loop you want to run continuously after delays with setTimeout (regardless of connections) where would that code go and be executed from?</p>
  
  <p>It looks like the code would go in the services directory, but where do I start the loop?  I tried in the app.js, but that doesn't work once sails is lifted it doesn't look like </p>
  
  <p><strong>Simple Example</strong></p>
  
  <pre><code>// MyFoo.js
  module.exports = {
  
      shouldFoo: true,
  
      doFoo: function(){
          if(this.shouldFoo){
              console.log('fooing ...');
              setTimeout(foo, 1000);
          } else {
              this.shutdownFoo();
          }
      },
  
      shutdownFoo: function(){
          // finish up process
      }
  }
  </code></pre>
  
  <p>Then where do I put:</p>
  
  <pre><code>var fooer = require('./api/services/MyFoo.js');
  fooer.doFoo();
  </code></pre>