title: twitter4j: Running in asynchrounous mode
body: <p>i have list of twitter user ids in a file. And i am required to collect tweets of all the users in that file. Currently i am able to fetch tweets of all users. But i need to run is code forever. Currently i am doing something like this</p>
  
  <pre><code>while(true)  //run forever
  {
         open(user ids file);
         while(there is more ids in file)
         {
               long id = readIDFromFile(file);
               List&lt;Status&gt; statuses = getTweetsForUser(id);
               appendListToTweetFile(statuses);                 
         }
         close(user ids file);
  }
  </code></pre>
  
  <p>The reason i want to run it forever so that if there is any new tweet posted by any user i am able to record it. My question is is there a better way to run this code forever, I know keeping the code in infinite loop is not a good idea!!!</p>