namespace Elsa.Workflows.Runtime; /// /// Invokes activities from a background worker within the context of its workflow instance. /// public interface IBackgroundActivityScheduler { /// /// Creates a scheduled job for the specified activity for execution in the background without starting the job. /// The caller is responsible for starting the job. /// /// The activity to schedule fo background execution. /// The cancellation token. /// A handle representing the asynchronous invocation. Task CreateAsync(ScheduledBackgroundActivity scheduledBackgroundActivity, CancellationToken cancellationToken = default); /// /// Scheduled the specified job. /// Task ScheduleAsync(string jobId, CancellationToken cancellationToken = default); /// /// Schedules the specified activity for execution in the background. /// /// The activity to schedule fo background execution. /// The cancellation token. /// A handle representing the asynchronous invocation. Task ScheduleAsync(ScheduledBackgroundActivity scheduledBackgroundActivity, CancellationToken cancellationToken = default); /// /// Removes the specified job from the schedule. /// Task UnscheduledAsync(string jobId, CancellationToken cancellationToken = default); /// /// Cancels the specified job. /// /// the ID of the job to cancel. /// The cancellation token. Task CancelAsync(string jobId, CancellationToken cancellationToken = default); }