Table of Contents

Class ProcessingPayloadsRegistry<T>

Namespace
FoundationaLLM.DataPipelineEngine.Services.Queueing
Assembly
FoundationaLLM.DataPipelineEngine.dll

Maintains a registry of payloads that are currently being processed.

public class ProcessingPayloadsRegistry<T>

Type Parameters

T
Inheritance
ProcessingPayloadsRegistry<T>
Inherited Members
Extension Methods

Constructors

ProcessingPayloadsRegistry(IMessageQueueService<T>, ILogger)

Maintains a registry of payloads that are currently being processed.

public ProcessingPayloadsRegistry(IMessageQueueService<T> messageQueueService, ILogger logger)

Parameters

messageQueueService IMessageQueueService<T>

The message queue service providing queueing capabilities.

logger ILogger

The logger used for logging.

Methods

ExtendPayloadsProcessingTime(IEnumerable<string>, bool)

Extends the processing time for the specified payloads.

public Task ExtendPayloadsProcessingTime(IEnumerable<string> payloadIds, bool recoverFromError = false)

Parameters

payloadIds IEnumerable<string>

The list of payload identifiers for which processing time is extended.

recoverFromError bool

Indicates whether the extension is required to attempt to recover from an error.

Returns

Task

Remarks

This operation ensures that the specified payloads can continue to be processed without running the risk of being dequeued due to timeout and generating a processing race condition.

IgnorePayloads(IEnumerable<string>)

Ignores a list of payloads.

public Task IgnorePayloads(IEnumerable<string> payloadIds)

Parameters

payloadIds IEnumerable<string>

The list of payload identifiers to ignore.

Returns

Task

NewPayloadsAvailable()

Indicates whether there are new payloads available for processing.

public Task<bool> NewPayloadsAvailable()

Returns

Task<bool>

true if there are payloads available, false otherwise.

ReceivePayloadsForProcessing(int, Func<T, string>)

Receives a specified number of payloads for processing.

public Task<IEnumerable<T>> ReceivePayloadsForProcessing(int payloadsCount, Func<T, string> idSelector)

Parameters

payloadsCount int

The maximum number of payloads to receive.

idSelector Func<T, string>

The identifier selector for a payload.

Returns

Task<IEnumerable<T>>

A list containing the received payloads.

RemovePayload(string, bool)

Removes a payload.

public Task RemovePayload(string payloadId, bool deleteMessage = true)

Parameters

payloadId string

The identifier of the payload to remove.

deleteMessage bool

Indicates whether the underlying message should be deleted as well.

Returns

Task