sqlitemulti/sqlitemulti/sqlitemulti.py
def _run_garbage_collector(self):
        """We suppose we will run the GC often enough that we won't delete queues that could be used."""
        if self._verbose:
            print("Experimental GC")
        now = time()
        with self._result_queues_lock:
            to_remove = []
            for tid, value in self._result_queues.items():
                if value[1] < now:
                    # TODO: Check that queue is empty?
                    # If not, there will be a local reference to that queue somewhere, so it should be ok.
                    to_remove.append(tid)
            for tid in to_remove:
                self._result_queues.pop(tid)
                if self._verbose:
                    print(f"Removed Result Queue for Thread {tid}")
        self._trigger_garbage_collector = False
We suppose we will run the GC often enough that we won't delete queues that could be used.
We suppose we will run the GC often enough that we won't delete queues that could be used.
We suppose we will run the GC often enough that we won ' t delete queues that could be used .
def _run_garbage_collector(self):
        if self._verbose:
            print("Experimental GC")
        now = time()
        with self._result_queues_lock:
            to_remove = []
            for tid, value in self._result_queues.items():
                if value[1] < now:
                    to_remove.append(tid)
            for tid in to_remove:
                self._result_queues.pop(tid)
                if self._verbose:
                    print(f"Removed Result Queue for Thread {tid}")
        self._trigger_garbage_collector = False
def _run_garbage_collector ( self ) : if self . _verbose : print ( "Experimental GC" ) now = time ( ) with self . _result_queues_lock : to_remove = [ ] for tid , value in self . _result_queues . items ( ) : if value [ 1 ] < now : to_remove . append ( tid ) for tid in to_remove : self . _result_queues . pop ( tid ) if self . _verbose : print ( f"Removed Result Queue for Thread {tid}" ) self . _trigger_garbage_collector = False
We suppose we will run the GC often enough that we won't delete queues that could be used.
We suppose we will run the GC often enough that we won ' t delete queues that could be used .
"""We suppose we will run the GC often enough that we won't delete queues that could be used.""" # TODO: Check that queue is empty? # If not, there will be a local reference to that queue somewhere, so it should be ok.
self