asynchronous#

ansys.fluent.core.utils.async_execution.asynchronous(f)#

Use for decorating functions that are to execute asynchronously. The decorated function returns a future object. Calling result() on the future object synchronizes the function execution.

Examples

>>> # asynchronous execution using @asynchronous decorator
>>> @asynchronous
... def asynchronous_solve(session, number_of_iterations):
...     session.solver.tui.solve.iterate(number_of_iterations)
>>> asynchronous_solve(session1, 100)
>>> # using the asynchronous function directly
>>> asynchronous(session2.solver.tui.solve.iterate)(100)
>>> # synchronous execution of above 2 calls
>>> asynchronous_solve(session1, 100).result()
>>> asynchronous(session2.solver.tui.solve.iterate)(100).result()
Return type:

Callable