How check if a task is already in python Queue?

后端 未结 12 2448
青春惊慌失措
青春惊慌失措 2020-12-05 15:04

I\'m writing a simple crawler in Python using the threading and Queue modules. I fetch a page, check links and put them into a queue, when a certain thread has finished proc

12条回答
  •  执念已碎
    2020-12-05 15:56

    Also, instead of a set you might try using a dictionary. Operations on sets tend to get rather slow when they're big, whereas a dictionary lookup is nice and quick.

    My 2c.

提交回复
热议问题