Table of Contents

Class PollingResourceRunner<TResource>

Namespace
FoundationaLLM.Common.Clients
Assembly
FoundationaLLM.Common.dll

Runs a resource using a polling mechanism to check for completion.

public class PollingResourceRunner<TResource> where TResource : ResourceBase, IRunnableResource

Type Parameters

TResource

The type of the runnable resource to run.

Inheritance
PollingResourceRunner<TResource>
Inherited Members
Extension Methods

Methods

Start(string, IResourceProviderService, TResource, TimeSpan, TimeSpan, ILogger, UnifiedUserIdentity, CancellationToken)

Runs the resource and waits for it to complete.

public static Task<bool> Start(string instanceId, IResourceProviderService resourceProviderService, TResource resource, TimeSpan pollingInterval, TimeSpan maxWaitInterval, ILogger logger, UnifiedUserIdentity userIdentity, CancellationToken cancellationToken = default)

Parameters

instanceId string

The FoundationaLLM instance identifier.

resourceProviderService IResourceProviderService

The resource provider service that manages the runnable resource.

resource TResource

The runnable resource to run.

pollingInterval TimeSpan

The interval to poll for the status.

maxWaitInterval TimeSpan

The maximum interval to wait for the resource run to complete.

logger ILogger

The logger used for logging.

userIdentity UnifiedUserIdentity

The identity of the user driving the run.

cancellationToken CancellationToken

The cancellation token indicating the need to cancel the run.

Returns

Task<bool>