Skip to main content

NewActionsClient

Creates a new Kubernetes-based actions client. This function initializes the client with a Kubernetes client, shared cache, buffer size, number of workers, and a run client, optionally configuring a Bloom filter for record deduplication.

def NewActionsClient(
k8sClient: client.WithWatch,
sharedCache: ctrlcache.Cache,
bufferSize: int,
numWorkers: int,
runClient: workflowconnect.InternalRunServiceClient,
recordFilterSize: int,
scope: promutils.Scope
) - > *ActionsClient

Creates a new Kubernetes-based actions client. This client is used to manage and interact with actions within a Kubernetes environment.

Parameters

NameTypeDescription
k8sClientclient.WithWatchThe Kubernetes client with watch capabilities, used for interacting with the Kubernetes API.
sharedCachectrlcache.CacheA shared cache for Kubernetes objects, used to reduce direct API calls and improve performance.
bufferSizeintThe size of the buffer for action updates, controlling how many updates can be queued before processing.
numWorkersintThe number of worker goroutines to process action updates. If set to 0 or less, it defaults to 1.
runClientworkflowconnect.InternalRunServiceClientThe client for internal run services, used to communicate with workflow execution components.
recordFilterSizeintThe size for the record filter, used to deduplicate action records. If greater than 0, a Bloom filter is initialized for deduplication.
scopepromutils.ScopeThe Prometheus metrics scope for reporting metrics related to the actions client.

Returns

TypeDescription
*ActionsClientA new instance of the ActionsClient configured with the provided parameters.