def _cleanup_buffer(self):
        '''
        Periodically cleanup the buffer.
        '''
        if not self._buffer:
            return
        while True:
            time.sleep(60)
            log.debug('Cleaning up buffer')
            items = self._buffer.items()
            # The ``items`` function should also cleanup the buffer
            log.debug('Collected items')
            log.debug(list(items))
def _cleanup_buffer ( self ) : if not self . _buffer : return while True : time . sleep ( 60 ) log . debug ( 'Cleaning up buffer' ) items = self . _buffer . items ( ) log . debug ( 'Collected items' ) log . debug ( list ( items ) )
Periodically cleanup the buffer.