本文整理汇总了Python中multiprocessing.util.sub_debug函数的典型用法代码示例。如果您正苦于以下问题:Python sub_debug函数的具体用法?Python sub_debug怎么用?Python sub_debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sub_debug函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reduce_handle
def reduce_handle(handle):
if Popen.thread_is_spawning():
return (None, Popen.duplicate_for_child(handle), True)
dup_handle = duplicate(handle)
_cache.add(dup_handle)
sub_debug('reducing handle %d', handle)
return (_get_listener().address, dup_handle, False)
示例2: rebuild_handle
def rebuild_handle(pickled_data):
address, handle, inherited = pickled_data
if inherited:
return handle
sub_debug('rebuilding handle %d', handle)
conn = Client(address, authkey=current_process().authkey)
conn.send((handle, os.getpid()))
new_handle = recv_handle(conn)
conn.close()
return new_handle
示例3: __init__
def __init__(self, address, backlog=None):
self._address = address
self._handle_queue = [self._new_handle(first=True)]
self._last_accepted = None
sub_debug('listener created with address=%r', self._address)
self.close = Finalize(
self, PipeListener._finalize_pipe_listener,
args=(self._handle_queue, self._address), exitpriority=0
)
示例4: __call__
def __call__(self, *args, **kwargs):
'''
Run the callback unless it has already been called or cancelled
'''
if self._pid != os.getpid():
util.sub_debug('finalizer ignored because different process')
self._weakref = self._callback = self._args = \
self._kwargs = self._key = None
return None
else:
return UnpatchedFinalize.__call__(self, *args, **kwargs)
示例5: _finalize_pipe_listener
def _finalize_pipe_listener(queue, address):
sub_debug('closing listener with address=%r', address)
for handle in queue:
close(handle)