源码 进程终止时间

pikaadapterslocking_connection.py


def start_consuming(self):
"""Processes I/O events and dispatches timers and `basic_consume`
callbacks until all consumers are cancelled.

NOTE: this blocking function may not be called from the scope of a
pika callback, because dispatching `basic_consume` callbacks from this
context would constitute recursion.

:raises pika.exceptions.RecursionError: if called from the scope of a
`BlockingConnection` or `BlockingChannel` callback

"""
# Check if called from the scope of an event dispatch callback
with self.connection._acquire_event_dispatch() as dispatch_allowed:
if not dispatch_allowed:
raise exceptions.RecursionError(
'start_consuming may not be called from the scope of '
'another BlockingConnection or BlockingChannel callback')

# Process events as long as consumers exist on this channel
while self._consumer_infos:
self.connection.process_data_events(time_limit=None)


通过分析源码,得出进程终止时间

消费服务的存活不能由start_consuming决定。









原文地址:https://www.cnblogs.com/rsapaper/p/10511705.html