I have a function that is going to request sites. I want to multithread this to make it faster of course, however, after trying many methods ranging from concurrent.futures to threading module, they either do not work, stop working after a while or simply are too unreliable. Are there any methods of multithreading relating to one function that is reliable and fast?
My Code:
import requests
import concurrent.futures
def example_request():
requests.get("www.bing.com")
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
while True:
executor.submit(example_request)
Hope someone can help thanks!!!!!!