mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-19 00:02:11 +00:00
Threading att 1
This commit is contained in:
@@ -8,6 +8,9 @@ ENCODING = "utf-8"
|
||||
CHUNk = "_chunk.txt"
|
||||
_sentinel = object()
|
||||
|
||||
#TODO: Doisy wchodzą jako lista krotek (doi, False) - po znalezieniu zaznaczamy na True i potem już nie porównujemy
|
||||
#TODO: lista krotek - jeśli wszystkie mają True dajemy terma
|
||||
|
||||
def producer(out_q, control_q, filename):
|
||||
with open(DATABASE_PATH + filename, "r+", encoding=ENCODING) as operated_file:
|
||||
lines = operated_file.readlines()
|
||||
@@ -28,6 +31,7 @@ def producer(out_q, control_q, filename):
|
||||
|
||||
|
||||
#IMPORTANT!!! ONLY ONE CONSUMER THREAD AS WE ARE NOT PUTTING SENTINELS BACK
|
||||
#TODO: Change doi to tuple list and only put term when all doi are found => (doi, True)
|
||||
def consumer(in_q, control_q, doi):
|
||||
sentinels = 0
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user