CallCoordinator#

class ansys.fluent.mcp.common.host.operations.CallCoordinator(*, replay_ttl_s: float = REPLAY_TTL_S, clock: Callable[[], float] = time.monotonic)#

Join, shield and replay mutating tool calls for one server.

Parameters:
replay_ttl_sfloat, default: REPLAY_TTL_S

Seconds a finished idempotent result can be replayed.

clockCallable[[], float], default: time.monotonic

Monotonic clock, injectable for tests.

Overview#

run

Run a mutating call, joining or replaying an identical one when possible.

Import detail#

from ansys.fluent.mcp.common.host.operations import CallCoordinator

Method detail#

async CallCoordinator.run(key: tuple[str, str], start: Callable[[], Awaitable[Any]], *, idempotent: bool) → Any#

Run a mutating call, joining or replaying an identical one when possible.

Parameters:
keytuple[str, str]

Call identity from call_key().

startCallable[[], Awaitable[Any]]

Starts the actual tool call.

idempotentbool

Whether repeating the call with the same arguments is harmless.

Returns:
Any

The tool result.