python loop over asynchronously updated list

Viewed 13

I've got a list called "current_data" that is updated asynchronously.

If I simply run a loop over it that prints the last record it repeats the same list without considering the subsequent insertions.

so, if I run in Jupyter "current_data" it does show the updates

However, if I run a loop over the "current_data" list the list in the loop remains the same as per the first iteration:

for n in range(1, 10000):
    print(current_data[-1])

How can I loop over the list? Is it necessary to "+=" a function?

0 Answers
Related