Skip to content

Instantly share code, notes, and snippets.

@methane
Created April 21, 2014 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save methane/11133820 to your computer and use it in GitHub Desktop.
Save methane/11133820 to your computer and use it in GitHub Desktop.
import pymemcache.client
import time
client = pymemcache.client.Client(('localhost', 11211))
for _ in range(1000):
for i in range(10000):
k = "foo%d" % i
x = str(time.time())
if not isinstance(x, bytes):
k = k.encode('ascii')
x = x.encode('ascii')
client.set(k, x, noreply=True)
#client.set(k, x, noreply=False)
client.close()
z = client.get(k)
if x != z:
print(k, x, z)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment