Table of Contents

Class MemoryRequestSourceService

Namespace
FoundationaLLM.Vectorization.Services.RequestSources
Assembly
FoundationaLLM.Vectorization.Engine.dll

Implements an in-memory request source, suitable for testing and quick prototyping.

public class MemoryRequestSourceService : IRequestSourceService
Inheritance
MemoryRequestSourceService
Implements
Inherited Members
Extension Methods

Constructors

MemoryRequestSourceService(RequestSourceServiceSettings, ILogger<MemoryRequestSourceService>)

Implements an in-memory request source, suitable for testing and quick prototyping.

public MemoryRequestSourceService(RequestSourceServiceSettings settings, ILogger<MemoryRequestSourceService> logger)

Parameters

settings RequestSourceServiceSettings

The settings used to initialize the request source.

logger ILogger<MemoryRequestSourceService>

The logger instnce used for logging.

Properties

SourceName

The name of the vectorization request source.

public string SourceName { get; }

Property Value

string

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 requestId, string popReceipt)

Parameters

requestId string
popReceipt string

This value is required to delete the request.

Returns

Task

HasRequests()

Indicates whether the source has pending requests.

public Task<bool> HasRequests()

Returns

Task<bool>

A bool indicating whether the source has pending requests or not.

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

count int

The 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 SubmitRequest(string requestName)

Parameters

requestName string

The name (unique identifier) of the vectorization request.

Returns

Task