buildgrid.client.actioncache module

class buildgrid.client.actioncache.ActionCacheClient(channel: Channel, instance: str | None = None, retries: int = 0, max_backoff: int = 64, should_backoff: bool = True)

Bases: object

Remote ActionCache service client helper.

The ActionCacheClient class comes with a generator factory function that can be used together with the with statement for context management:

from buildgrid.client.actioncache import query

with query(channel, instance='build') as action_cache:
    digest, action_result = action_cache.get(action_digest)
get(action_digest: Digest) ActionResult | None

Attempt to retrieve cached ActionResult for : given obj:Action.

update(action_digest: Digest, action_result: ActionResult) ActionResult | None

Attempt to map in cache an Action to an ActionResult.

close() None

Closes the underlying connection stubs.

buildgrid.client.actioncache.query(channel: Channel, instance: str | None = None, retries: int = 0, max_backoff: int = 64, should_backoff: bool = True) Iterator[ActionCacheClient]

Context manager generator for the ActionCacheClient class.