-
-
Save rcoh/d8c119441f0b2789a36cc3368e1273c0 to your computer and use it in GitHub Desktop.
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
from threading import Thread | |
from ghost import Ghost | |
ghost = Ghost() | |
def make_ghost_request(): | |
while True: | |
with ghost.start() as sess: | |
sess.open('http://www.reddit.com') | |
sess.wait_for_page_loaded() | |
def start_task_thread(): | |
t = Thread(target=make_ghost_request) | |
t.daemon = True | |
t.start() | |
THREAD_COUNT = 4 | |
for i in range(THREAD_COUNT): | |
start_task_thread() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment