本文整理匯總了Python中libmc.Client.config方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.config方法的具體用法?Python Client.config怎麽用?Python Client.config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類libmc.Client
的用法示例。
在下文中一共展示了Client.config方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: import
# 需要導入模塊: from libmc import Client [as 別名]
# 或者: from libmc.Client import config [as 別名]
from libmc import (Client, MC_HASH_MD5, MC_POLL_TIMEOUT,
MC_CONNECT_TIMEOUT, MC_RETRY_TIMEOUT)
from app.mc.decorators import create_cache
mc = Client(
['localhost'],
do_split=True,
comp_threshold=0,
noreply=False,
prefix=None,
hash_fn=MC_HASH_MD5,
failover=False
)
mc.config(MC_CONNECT_TIMEOUT, 300) # ms
mc.config(MC_POLL_TIMEOUT, 100)
mc.config(MC_RETRY_TIMEOUT, 5)
globals().update(create_cache(mc))
示例2: import
# 需要導入模塊: from libmc import Client [as 別名]
# 或者: from libmc.Client import config [as 別名]
# coding=utf-8
from libmc import (
Client, MC_HASH_MD5, MC_POLL_TIMEOUT, MC_CONNECT_TIMEOUT, MC_RETRY_TIMEOUT
)
from mc_decorator import create_decorators
mc = Client(
[
'localhost',
'localhost:11212',
'localhost:11213 mc_213'
],
do_split=True,
comp_threshold=0,
noreply=False,
prefix=None,
hash_fn=MC_HASH_MD5,
failover=False
)
mc.config(MC_POLL_TIMEOUT, 100) # 100 ms
mc.config(MC_CONNECT_TIMEOUT, 300) # 300 ms
mc.config(MC_RETRY_TIMEOUT, 5) # 5 s
globals().update(create_decorators(mc))