CronTickerEntity
Entity for cron-based recurring job scheduling.
Type Definition
csharp
public class CronTickerEntity : BaseTickerEntity
{
public string Expression { get; set; }
public byte[] Request { get; set; }
public int Retries { get; set; }
public int[] RetryIntervals { get; set; }
}Properties
| Property | Type | Access | Description |
|---|---|---|---|
Expression | string | Read/Write | Cron expression (6-part format required: second minute hour day month day-of-week) |
Request | byte[] | Read/Write | Serialized request data (use TickerHelper.CreateTickerRequest) |
Retries | int | Read/Write | Maximum number of retry attempts |
RetryIntervals | int[] | Read/Write | Retry intervals in seconds |
Cron Expression Format
Must be 6-part format: second minute hour day month day-of-week
Examples:
"0 0 0 * * *"- Daily at midnight"0 0 9 * * *"- Daily at 9:00 AM"0 */5 * * * *"- Every 5 minutes"*/10 * * * * *"- Every 10 seconds"0 0 9,17 * * *"- At 9 AM and 5 PM daily"0 30 14 * * 1"- Every Monday at 2:30 PM
Required Format
All cron expressions must include the seconds field (6 parts). The format is: second minute hour day month day-of-week.
Example Usage
csharp
var cronTicker = new CronTickerEntity
{
Function = "GenerateDailyReport",
Description = "Daily sales report",
Expression = "0 0 0 * * *", // Daily at midnight
Request = TickerHelper.CreateTickerRequest(new ReportRequest
{
ReportType = "Daily"
}),
Retries = 2,
RetryIntervals = new[] { 300, 900 }
};Property Constraints
Function- Must not be null or empty, must match[TickerFunction]attributeExpression- Must be valid 6-part cron expression that is parseable- Expression must calculate a valid next occurrence
See Also
- TimeTickerEntity - Time-based jobs
- CronTickerOccurrenceEntity - Individual execution occurrences
- Manager APIs - Creating and managing CronTicker jobs
- Job Types - Understanding cron jobs
