Skip to content

Instantly share code, notes, and snippets.

@farshidce
Created July 17, 2017 15:53
Show Gist options
  • Save farshidce/3dee339a30842be340361e547e6227c4 to your computer and use it in GitHub Desktop.
Save farshidce/3dee339a30842be340361e547e6227c4 to your computer and use it in GitHub Desktop.
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