本文整理汇总了Python中threadpool.ThreadPool.put方法的典型用法代码示例。如果您正苦于以下问题:Python ThreadPool.put方法的具体用法?Python ThreadPool.put怎么用?Python ThreadPool.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类threadpool.ThreadPool
的用法示例。
在下文中一共展示了ThreadPool.put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: processing
# 需要导入模块: from threadpool import ThreadPool [as 别名]
# 或者: from threadpool.ThreadPool import put [as 别名]
def processing(tables):
import opts
options, _ = opts.parse_options()
master_connect_setting, slaver_connect_setting = opts.parse_connection(options)
master = SqlPool(**master_connect_setting)
slaver = SqlPool(**slaver_connect_setting)
if not tables and options.tables:
tables = options.tables
if not tables:
tables = show_tables(slaver)
pool = ThreadPool(options.thread)
for tb in tables:
ignored = False
for i in options.tables_ignored:
if tb.startswith(i):
ignored = True
break
if ignored: continue
if tb not in ['qing_filerecycle', 'qing_file_storage'] and \
options.checksum and checksum_table(master, slaver, tb) == True:
logging.warn("Table[%s] on slave was the smae as master . OK", tb)
continue
checker = TableChecker(master, slaver, tb,
setp = 1000,
used_select_all = bool(tb in options.tables_select_all),
fix_diff=options.fix_diff)
pool.put(checker.run)
pool.join()