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
messageQueueServiceIMessageQueueService<T>The message queue service providing queueing capabilities.
loggerILoggerThe 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
payloadIdsIEnumerable<string>The list of payload identifiers for which processing time is extended.
recoverFromErrorboolIndicates whether the extension is required to attempt to recover from an error.
Returns
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
payloadIdsIEnumerable<string>The list of payload identifiers to ignore.
Returns
NewPayloadsAvailable()
Indicates whether there are new payloads available for processing.
public Task<bool> NewPayloadsAvailable()
Returns
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
payloadsCountintThe maximum number of payloads to receive.
idSelectorFunc<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
payloadIdstringThe identifier of the payload to remove.
deleteMessageboolIndicates whether the underlying message should be deleted as well.