Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ def fetch(session, url):
with session.get(url) as response:
print(response.json()['uuid'])


@timer(1, 1)
def main():
with Pool() as pool:
with requests.Session() as session:
pool.starmap(fetch, [(session, URL) for _ in range(100)])
if __name__ == "__main__":
@timer(1, 1)

def main():
with Pool() as pool:
with requests.Session() as session:
pool.starmap(fetch, [(session, URL) for _ in range(100)])