Skip to content

Instantly share code, notes, and snippets.

@wozozo wozozo/test.py
Created May 31, 2017

Embed
What would you like to do?
import threading
from uuid import uuid4
import redis
r = redis.StrictRedis(host='', port=0, db=0, password='')
class Attacker(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name
def run(self):
for i in range(1000):
key = str(uuid4())
r.set(key, i)
print(f'{self.name}: {i} ({key})')
for i in range(20):
attacker_ = Attacker(f'Attacker{i}')
attacker_.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.