FrameProcessor: remove deprecated wait_for_task()
This commit is contained in:
@@ -527,33 +527,6 @@ class FrameProcessor(BaseObject):
|
|||||||
"""
|
"""
|
||||||
await self.task_manager.cancel_task(task, timeout)
|
await self.task_manager.cancel_task(task, timeout)
|
||||||
|
|
||||||
async def wait_for_task(self, task: asyncio.Task, timeout: Optional[float] = None):
|
|
||||||
"""Wait for a task to complete.
|
|
||||||
|
|
||||||
.. deprecated:: 0.0.81
|
|
||||||
This function is deprecated, use `await task` or
|
|
||||||
`await asyncio.wait_for(task, timeout)` instead.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
task: The task to wait for.
|
|
||||||
timeout: Optional timeout for waiting.
|
|
||||||
"""
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
with warnings.catch_warnings():
|
|
||||||
warnings.simplefilter("always")
|
|
||||||
warnings.warn(
|
|
||||||
"`FrameProcessor.wait_for_task()` is deprecated. "
|
|
||||||
"Use `await task` or `await asyncio.wait_for(task, timeout)` instead.",
|
|
||||||
DeprecationWarning,
|
|
||||||
stacklevel=2,
|
|
||||||
)
|
|
||||||
|
|
||||||
if timeout:
|
|
||||||
await asyncio.wait_for(task, timeout)
|
|
||||||
else:
|
|
||||||
await task
|
|
||||||
|
|
||||||
async def setup(self, setup: FrameProcessorSetup):
|
async def setup(self, setup: FrameProcessorSetup):
|
||||||
"""Set up the processor with required components.
|
"""Set up the processor with required components.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user