asyncx_ros2.ensure_aio_future

asyncx_ros2.ensure_aio_future(coro_or_future, *, loop=None)[source]

Wrap an object in a asyncio.Future.

Parameters
  • coro_or_future (Any) – A rclpy.task.Future object or an awaitable object including asyncio.Task, asyncio.Future, and coroutine.

  • loop (Optional[asyncio.AbstractEventLoop]) – An event loop to wait for the completion of future

Returns

A asyncio.Future object that wraps the given future

Return type

asyncio.Future[Any]