[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] resultdump: Document how the results are gotten



commit 43add2481a4084412798f6a62db2c5c9e9511639
Author: juga0 <juga@xxxxxxxxxx>
Date:   Sat Feb 16 14:47:12 2019 +0000

    resultdump: Document how the results are gotten
    
    from the thread.
---
 sbws/lib/resultdump.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/sbws/lib/resultdump.py b/sbws/lib/resultdump.py
index 52a0b7c..384bd42 100644
--- a/sbws/lib/resultdump.py
+++ b/sbws/lib/resultdump.py
@@ -582,7 +582,22 @@ class ResultDump:
         log.info(msg)
 
     def enter(self):
-        ''' Main loop for the ResultDump thread '''
+        """Main loop for the ResultDump thread.
+
+        When there are results in the queue, queue.get will get them until
+        there are not anymore or timeout happen.
+
+        For every result it gets, it process it and store in the filesystem,
+        which takes ~1 millisecond and will not trigger the timeout.
+        It can then store in the filesystem ~1000 results per second.
+
+        I does not accept any other data type than Results or list of Results,
+        therefore is not possible to put big data types in the queue.
+
+        If there are not any results in the queue, it waits 1 second and checks
+        again.
+
+        """
         with self.data_lock:
             self.data = load_recent_results_in_datadir(
                 self.fresh_days, self.datadir)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits