Created
August 15, 2014 00:00
-
-
Save wrunk/d1c13fd19b01a30107b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_thread_func(comment_id): | |
# form url based on comment id so http://www.evite.com/services/<comment_id>/whatever | |
# send request | |
# check result, log error | |
from multiprocessing.pool import ThreadPool as Pool | |
def main(): | |
# Read file into a list of IDs | |
list_of_ids = [read from file] | |
pool = Pool(processes=4) # start 4 worker threads in this case | |
print pool.map(my_thread_func, list_of_ids) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment