This file contains 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
import gevent.monkey | |
import requests | |
gevent.monkey.patch_all() | |
urls = ['https://www.google.com', 'https://www.yahoo.com', 'https://www.geektime.co.il'] | |
def is_online(url): | |
response = requests.get(url=url) | |
if (response.ok): | |
print(f"Site is online: {url}") |
This file contains 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
import threading | |
import multiprocessing | |
import asyncio | |
import time | |
import requests | |
import httpx | |
URL = "https://httpbin.org/delay/2" | |
NOR = 1000 |