Beispiel #1
0
key, opaque = "silentincr", 98428747
empty(key)

mc.incrq(key, 0, 0, 0, nosend=True)
res = mc.incr (key, 0)
iequal(res[0]['val'], 0)

mc.incrq(key, 8, 0, 0, nosend=True)
res = mc.incr (key, 0)
iequal(res[0]['val'], 8)

# Silent decrement
print("""#-----------------------------# silent decrement #----------------------------#""")
key, opaque = "silentdecr", 98428747
empty(key)
mc.decrq(key, 0, 0, 185, nosend=True)
res = mc.decr (key, 0)
iequal(res[0]['val'], 185)
mc.decrq(key, 8, 0, 0, nosend=True)
res = mc.decr (key, 0)
iequal(res[0]['val'], 177)

print("""#-------------------------------# silent flush #------------------------------#""")
stat1 = mc.stat()
set("x", 5, 19, "somevaluex")
set("y", 5, 19, "somevaluey")
mc.flushq(nosend=True)
empty("x")
empty("y")

stat2 = mc.stat()
Beispiel #2
0
key, opaque = "silentincr", 98428747
empty(key)

mc.incrq(key, 0, 0, 0, nosend=True)
res = mc.incr(key, 0)
iequal(res[0]["val"], 0)

mc.incrq(key, 8, 0, 0, nosend=True)
res = mc.incr(key, 0)
iequal(res[0]["val"], 8)

# Silent decrement
print ("""#-----------------------------# silent decrement #----------------------------#""")
key, opaque = "silentdecr", 98428747
empty(key)
mc.decrq(key, 0, 0, 185, nosend=True)
res = mc.decr(key, 0)
iequal(res[0]["val"], 185)
mc.decrq(key, 8, 0, 0, nosend=True)
res = mc.decr(key, 0)
iequal(res[0]["val"], 177)

print ("""#-------------------------------# silent flush #------------------------------#""")
stat1 = mc.stat()
set("x", 5, 19, "somevaluex")
set("y", 5, 19, "somevaluey")
mc.flushq(nosend=True)
empty("x")
empty("y")

stat2 = mc.stat()