Open ieguiguren opened 8 years ago
Sounds reasonable. For that purpose we could create an extra ProxyManager class which would store the proxies in a dictionary of the form Proxy:Response_time(ms) - Response time would be None at initialization time and at each iteration we would store the new time. Then we would query the ProxyManager for next_random or next_faster proxy.
When a proxy is checked, if request time is traced and kept, it may be used later to order the list of proxies per response speed, being able to return the fastest proxy in the list in stead of a random one. As checking the whole proxies list takes a while, it could return the fastest proxy as a fastest proxy appears during checks.
I can't tag this as 'enhancement'