Skip to content

TimeTickerEntity<TTimeTicker>

Entity for time-based job scheduling (one-time or specific date/time jobs).

Type Definition

csharp
public class TimeTickerEntity : TimeTickerEntity<TimeTickerEntity> { }

public class TimeTickerEntity<TTicker> : BaseTickerEntity 
    where TTicker : TimeTickerEntity<TTicker>
{
    // Properties...
}

Properties

PropertyTypeAccessDescription
StatusTickerStatusInternalCurrent execution status
ExecutionTimeDateTime?Read/WriteWhen to execute the job (converted to UTC)
Requestbyte[]Read/WriteSerialized request data (use TickerHelper.CreateTickerRequest)
ExecutedAtDateTime?InternalWhen the job was actually executed
ElapsedTimelongInternalExecution time in milliseconds
RetriesintRead/WriteMaximum number of retry attempts
RetryCountintInternalCurrent retry attempt number
RetryIntervalsint[]Read/WriteRetry intervals in seconds
ParentIdGuid?InternalParent job ID (for child jobs)
ParentTTickerNavigationParent job entity
ChildrenICollection&lt;TTicker&gt;Read/WriteChild jobs collection
RunConditionRunCondition?Read/WriteCondition for child job execution
LockHolderstringInternalNode/machine that locked the job
LockedAtDateTime?InternalWhen the job was locked
ExceptionMessagestringInternalException details if job failed
SkippedReasonstringInternalReason if job was skipped

Status Values

See TickerStatus enum for all possible status values.

Status Flow:

Idle → Queued → InProgress → Done/Failed/Cancelled/Skipped

Relationships

  • Parent-Child: Supports hierarchical job relationships
  • Children: Can have up to 5 direct children
  • Grandchildren: Children can have up to 5 grandchildren each

Example Usage

csharp
var ticker = new TimeTickerEntity
{
    Function = "ProcessOrder",
    Description = "Process order payment",
    ExecutionTime = DateTime.UtcNow.AddMinutes(30),
    Request = TickerHelper.CreateTickerRequest(new OrderRequest 
    { 
        OrderId = 12345 
    }),
    Retries = 3,
    RetryIntervals = new[] { 60, 300, 900 }
};

// Add children
ticker.Children.Add(new TimeTickerEntity
{
    Function = "SendConfirmation",
    ParentId = ticker.Id,
    RunCondition = RunCondition.OnSuccess,
    ExecutionTime = DateTime.UtcNow.AddMinutes(35)
});

Property Constraints

  • Function - Must not be null or empty, must match [TickerFunction] attribute
  • ExecutionTime - Required for scheduling (auto-set to UtcNow.AddSeconds(1) if null)
  • Cannot update if status is InProgress

See Also

Built by Albert Kunushevci