Ice.wrap_future¶
- Ice.wrap_future(future: Future | Future, *, loop: AbstractEventLoop | None = None) Future¶
Wraps an
Ice.Futureobject into anasyncio.Future.This function converts an
Ice.Futureinto anasyncio.Futureto allow integration of Ice’s asynchronous operations with Python’s asyncio framework. If the provided future is already anasyncio.Future, it is returned unchanged.If the
Ice.Futureis already completed, theasyncio.Futureis immediately resolved. Otherwise, completion callbacks are registered to ensure that theasyncio.Futurereflects the state of theIce.Future, including result propagation, exception handling, and cancellation.- Parameters:
future (Future | asyncio.Future) – The future object to wrap. If an
asyncio.Futureis passed, it is returned as-is.loop (asyncio.AbstractEventLoop | None, optional) – The event loop to associate with the
asyncio.Future. If not provided, the current event loop is used.
- Returns:
A future that mirrors the state of the provided
Ice.Future.- Return type:
- Raises:
AssertionError – If
futureis not an instance ofIce.Futureorasyncio.Future.