Class StorageQueueRequestSourceService
- Assembly
- FoundationaLLM.Vectorization.Engine.dll
Implements a request source that uses Azure storage queues.
public class StorageQueueRequestSourceService : IRequestSourceService
- Inheritance
-
StorageQueueRequestSourceService
- Implements
- Inherited Members
- Extension Methods
Constructors
StorageQueueRequestSourceService(RequestSourceServiceSettings, ILogger<StorageQueueRequestSourceService>)
Creates a new instance of the request source.
public StorageQueueRequestSourceService(RequestSourceServiceSettings settings, ILogger<StorageQueueRequestSourceService> logger)
Parameters
settingsRequestSourceServiceSettingsThe RequestSourceServiceSettings object providing the settings.
loggerILogger<StorageQueueRequestSourceService>The logger used for logging.
Properties
SourceName
The name of the vectorization request source.
public string SourceName { get; }
Property Value
Methods
DeleteRequest(string, string)
Removes a specified vectorization request from the source. This should happen when the request was successfully processed.
public Task DeleteRequest(string messageId, string popReceipt)
Parameters
messageIdstringThe underlying message identifier of the request being removed.
popReceiptstringThis value is required to delete the request.
Returns
HasRequests()
Indicates whether the source has pending requests.
public Task<bool> HasRequests()
Returns
ReceiveRequests(int)
Receives the specified number of requests. The received requests will be invisible for other clients for a default timeout of 30 seconds. They should be removed from the source by calling DeleteRequest(string, string) before the timeout expires.
public Task<IEnumerable<VectorizationDequeuedRequest>> ReceiveRequests(int count)
Parameters
countintThe number of requests to receive.
Returns
- Task<IEnumerable<VectorizationDequeuedRequest>>
A collection of VectorizationDequeuedRequest items.
SubmitRequest(string)
Submits a new vectorization request to the source.
public Task<string> SubmitRequest(string requestName)
Parameters
requestNamestringThe name (unique identifier) of the vectorization request.
Returns
TryUpdateRequest(string, string, TimeSpan)
Tries to update the visibility timeout of a request.
public Task<bool> TryUpdateRequest(string messageId, string popReceipt, TimeSpan visibilityTimeout)
Parameters
messageIdstringThe underlying message identifier of the request being updated.
popReceiptstringThe value requiored to update the underlying message.
visibilityTimeoutTimeSpanThe new visibility timeout of the request.