task: don't use push queue to send a heartbeat
This is because we might be waiting for the EndFrame. Currently, if we push an EndFrame to the task, the task will block until the EndFrame traverses all the pipeline.
This commit is contained in:
@@ -338,7 +338,10 @@ class PipelineTask:
|
||||
"""
|
||||
while True:
|
||||
try:
|
||||
await self.queue_frame(HeartbeatFrame(timestamp=self._clock.get_time()))
|
||||
# Don't use `queue_frame()` because if an EndFrame is queued the
|
||||
# task will just stop waiting for the pipeline to finish not
|
||||
# allowing more frames to be pushed.
|
||||
await self._source.queue_frame(HeartbeatFrame(timestamp=self._clock.get_time()))
|
||||
await asyncio.sleep(HEARTBEAT_SECONDS)
|
||||
except asyncio.CancelledError:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user