'Flush the cache.
If I{key} is specified, only that item is flushed.  Otherwise
the entire cache is flushed.
@param key: the key to flush
@type key: (dns.name.Name, int, int) tuple or None'

def flush(self, key=None):

    try:
        self.lock.acquire()
        if (key is not None):
            if (key in self.data):
                del self.data[key]
        else:
            self.data = {}
            self.next_cleaning = (time.time() + self.cleaning_interval)
    finally:
        self.lock.release()
