Skip to content

IDurableJobHandler

interface

Namespace: Orleans.DurableJobs

Defines the interface for handling durable job execution. Grains implement this interface to receive and process durable jobs.
public interface IDurableJobHandler

Remarks

Grains that implement this interface can be targeted by durable jobs. The IDurableJobHandler method is invoked when the job's due time is reached.

The following example demonstrates a grain that implements IDurableJobHandler:
public class MyGrain : Grain, IDurableJobHandler
{
public Task ExecuteJobAsync(IJobRunContext context, CancellationToken cancellationToken)
{
// Process the durable job
var jobName = context.Job.Name;
var dueTime = context.Job.DueTime;
// Perform job logic here
return Task.CompletedTask;
}
}

Methods