IJobShard
interface
Namespace: Orleans.DurableJobs
Represents a shard of durable jobs that manages a collection of jobs within a specific time range. A job shard is responsible for storing, retrieving, and managing the lifecycle of durable jobs that fall within its designated time window.
public interface IJobShard : IAsyncDisposableRemarks
Job shards are used to partition durable jobs across time ranges to improve scalability and performance. Each shard has a defined start and end time that determines which jobs it manages. Shards can be marked as complete when all jobs within their time range have been processed.
Properties
EndTimeGets the end time of the time range managed by this shard.IdGets the unique identifier for this job shard.IsAddingCompletedGets a value indicating whether this shard has been marked as complete and is no longer accepting new jobs.MetadataGets optional metadata associated with this job shard.StartTimeGets the start time of the time range managed by this shard.
Methods
ConsumeDurableJobsAsyncConsumes durable jobs from this shard in order of their due time.GetJobCountAsyncGets the number of jobs currently scheduled in this shard.MarkAsCompleteAsync(CancellationToken)Marks this shard as complete, preventing new jobs from being scheduled.RemoveJobAsync(string, CancellationToken)Removes a durable job from this shard.RetryJobLaterAsync(IJobRunContext, DateTimeOffset, CancellationToken)Reschedules a job to be retried at a later time.TryScheduleJobAsync(ScheduleJobRequest, CancellationToken)Attempts to schedule a new job on this shard.
