Created
July 17, 2017 15:53
-
-
Save farshidce/3dee339a30842be340361e547e6227c4 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
import gevent.monkey | |
gevent.monkey.patch_all() | |
import bmemcached | |
import threading | |
from threading import Thread | |
import time | |
import uuid | |
def ops(mc): | |
for i in range(0, 100): | |
mc.set(str(uuid.uuid4()), str(uuid.uuid4())) | |
time.sleep(0.1) | |
print ',', | |
ts = list() | |
gs = list() | |
for i in range(0, 3): | |
mc = bmemcached.Client(["localhost:11211"]) | |
for j in range(0, 5): | |
gs.append(gevent.spawn(ops, mc)) | |
time.sleep(0.1 | |
for g in gs: | |
g.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment