-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIJobProgressStore.cs
37 lines (34 loc) · 1.12 KB
/
IJobProgressStore.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Threading;
using System.Threading.Tasks;
using Jobba.Core.Models;
using Jobba.Core.Models.Entities;
namespace Jobba.Core.Interfaces.Repositories;
/// <summary>
/// Encapsulates logic for storing job progress.
/// </summary>
public interface IJobProgressStore
{
/// <summary>
/// Logs progress for the job to the store
/// </summary>
/// <param name="jobProgress">
/// A <see cref="JobProgress{TJobState}"/> record detailing progress for the job.
/// </param>
/// <param name="cancellationToken"></param>
/// <typeparam name="TJobState">
/// The type of job state.
/// </typeparam>
/// <returns></returns>
Task LogProgressAsync<TJobState>(JobProgress<TJobState> jobProgress, CancellationToken cancellationToken)
where TJobState : IJobState;
/// <summary>
/// Retrieves progress for a job by id.
/// </summary>
/// <param name="id">
/// The id of the job.
/// </param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<JobProgressEntity> GetProgressById(Guid id, CancellationToken cancellationToken);
}