IndexesMonitor

class aerospike_sdk.index_monitor.IndexesMonitor[source]

Bases: object

Async background task that caches secondary index metadata.

Start via start() (typically called by Client.connect). Retrieve cached data with get_index_context(). Stop via stop() (called by Client.close).

Example:

monitor = IndexesMonitor()
await monitor.start(client)
ctx = monitor.get_index_context("test")
await monitor.stop()
Parameters:

refresh_interval (float) – Seconds between cache refreshes (default 5.0).

__init__(refresh_interval=_DEFAULT_REFRESH_INTERVAL)[source]
async start(client)[source]

Begin background refresh. Waits up to 1 s for the first fetch.

Return type:

None

async stop()[source]

Cancel the background refresh task.

Return type:

None

get_index_context(namespace)[source]

Return the cached IndexContext for namespace, or None.

Return type:

Optional[IndexContext]