-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Made runtime registry more restrictive
- Loading branch information
1 parent
3adfd18
commit 8526904
Showing
4 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace NCronJob; | ||
|
||
/// <summary> | ||
/// Represents a builder for adding jobs at runtime. | ||
/// </summary> | ||
public interface IRuntimeJobBuilder | ||
{ | ||
/// <summary> | ||
/// Adds a job to the service collection that gets executed based on the given cron expression. | ||
/// </summary> | ||
/// <param name="options">Configures the <see cref="JobOptionBuilder"/>, like the cron expression or parameters that get passed down.</param> | ||
/// <returns>Returns the <see cref="IRuntimeJobBuilder"/> for chaining.</returns> | ||
IRuntimeJobBuilder AddJob<TJob>(Action<JobOptionBuilder>? options = null) where TJob : class, IJob; | ||
|
||
/// <summary> | ||
/// Adds a job to the service collection that gets executed based on the given cron expression. | ||
/// </summary> | ||
/// <param name="jobType">The type of the job to be added.</param> | ||
/// <param name="options">Configures the <see cref="JobOptionBuilder"/>, like the cron expression or parameters that get passed down.</param> | ||
/// <returns>Returns the <see cref="IRuntimeJobBuilder"/> for chaining.</returns> | ||
IRuntimeJobBuilder AddJob(Type jobType, Action<JobOptionBuilder>? options = null); | ||
|
||
/// <summary> | ||
/// Adds a job using an asynchronous anonymous delegate to the service collection that gets executed based on the given cron expression. | ||
/// </summary> | ||
/// <param name="jobDelegate">The delegate that represents the job to be executed.</param> | ||
/// <param name="cronExpression">The cron expression that defines when the job should be executed.</param> | ||
/// <param name="timeZoneInfo">The time zone information that the cron expression should be evaluated against. | ||
/// If not set the default time zone is UTC. | ||
/// </param> | ||
/// <param name="jobName">Sets the job name that can be used to identify and manipulate the job later on.</param> | ||
/// <returns>Returns the <see cref="IRuntimeJobBuilder"/> for chaining.</returns> | ||
IRuntimeJobBuilder AddJob(Delegate jobDelegate, | ||
string cronExpression, | ||
TimeZoneInfo? timeZoneInfo = null, | ||
string? jobName = null); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters