title: check a list constantly and do something if list has items
body: <p>I have a global list where items are added constantly (from network clients):</p>
  
  <pre><code>mylist = []
  def additem(uuid,work):
      mylist.append(uuid,work)
  </code></pre>
  
  <p>And a function which should check the list and if there are items proceed them:</p>
  
  <pre><code>def proceeditems():
  
    while True:
      itemdone = []
      if len(mylist) &gt; 0:
       for item in mylist:
         try:
            #This can go wrong and than need to be done again 
            result = gevent.spawn(somework(item))
            #result returns the uuid
            itemdone.append(result.value)
         except:
            pass
      for item in itemdone:
          mylist[:] = [value for value in mylist if value[0]!=item]
  </code></pre>
  
  <p>So I hope you get an idea now what I try to do, but I think the endless loop seems to be not the right solution.</p>