@@ -13,6 +13,30 @@ namespace Soenneker.Utils.BackgroundQueue.Abstract;
1313/// </remarks>
1414public interface IBackgroundQueue
1515{
16+ /// <summary>
17+ /// Queues a work item represented by a ValueTask for execution, passing the specified state to the work item
18+ /// delegate.
19+ /// </summary>
20+ /// <typeparam name="TState">The type of the state object to pass to the work item.</typeparam>
21+ /// <param name="state">The state object to pass to the work item delegate when it is executed.</param>
22+ /// <param name="workItem">A delegate that represents the work to execute. The delegate receives the provided state object.</param>
23+ /// <param name="cancellationToken">A cancellation token that can be used to cancel the queued work item before it starts executing. The default
24+ /// value is <see cref="CancellationToken.None"/>.</param>
25+ /// <returns>A ValueTask that represents the queued work item. The task completes when the work item has finished executing.</returns>
26+ ValueTask QueueValueTask < TState > ( TState state , ValueTaskWorkItem < TState > workItem , CancellationToken cancellationToken = default ) ;
27+
28+ /// <summary>
29+ /// Queues a work item for execution, passing the specified state to the provided delegate.
30+ /// </summary>
31+ /// <typeparam name="TState">The type of the state object to pass to the work item.</typeparam>
32+ /// <param name="state">The state object to pass to the work item when it is executed.</param>
33+ /// <param name="workItem">A delegate that represents the work item to execute. The delegate receives the specified state object.</param>
34+ /// <param name="cancellationToken">A cancellation token that can be used to cancel the queued work item before it starts executing. The default
35+ /// value is <see cref="CancellationToken.None"/>.</param>
36+ /// <returns>A <see cref="ValueTask"/> that represents the queued work item. The task completes when the work item has been
37+ /// executed or canceled.</returns>
38+ ValueTask QueueTask < TState > ( TState state , TaskWorkItem < TState > workItem , CancellationToken cancellationToken = default ) ;
39+
1640 /// <summary>
1741 /// Queues a <see cref="ValueTask"/> to be executed by the background service.
1842 /// </summary>
0 commit comments