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
stringThe FoundationaLLM instance identifier.
resourceProviderService
IResourceProviderServiceThe resource provider service that manages the runnable resource.
resource
TResourceThe runnable resource to run.
pollingInterval
TimeSpanThe interval to poll for the status.
maxWaitInterval
TimeSpanThe maximum interval to wait for the resource run to complete.
logger
ILoggerThe logger used for logging.
userIdentity
UnifiedUserIdentityThe identity of the user driving the run.
cancellationToken
CancellationTokenThe cancellation token indicating the need to cancel the run.