LevitTaskEvent constructor
LevitTaskEvent({
- required LevitTaskEventType type,
- required String taskId,
- String? executionId,
- String ownerPath = '?',
- LevitTaskPhase? phase,
- LevitTaskMetadata? metadata,
- TaskPriority priority = TaskPriority.normal,
- int attempt = 0,
- int maxRetries = 0,
- DateTime? queuedAt,
- DateTime? startedAt,
- DateTime? finishedAt,
- Duration? queueDuration,
- Duration? runDuration,
- Duration? retryIn,
- double? progress,
- TaskSkipReason? skipReason,
- LevitTaskOutcome? outcome,
- Object? error,
- StackTrace? stackTrace,
- bool? runsInIsolate,
- bool? runInIsolate,
- String? debugName,
- DateTime? timestamp,
Implementation
LevitTaskEvent({
required this.type,
required this.taskId,
String? executionId,
this.ownerPath = '?',
LevitTaskPhase? phase,
LevitTaskMetadata? metadata,
this.priority = TaskPriority.normal,
this.attempt = 0,
this.maxRetries = 0,
DateTime? queuedAt,
this.startedAt,
this.finishedAt,
this.queueDuration,
this.runDuration,
this.retryIn,
this.progress,
this.skipReason,
this.outcome,
this.error,
this.stackTrace,
bool? runsInIsolate,
bool? runInIsolate,
String? debugName,
DateTime? timestamp,
}) : executionId = executionId ?? taskId,
phase = phase ?? _phaseForEvent(type),
metadata = metadata ??
(debugName == null
? LevitTaskMetadata.none
: LevitTaskMetadata(debugName: debugName)),
runsInIsolate = runsInIsolate ?? runInIsolate ?? false,
timestamp = timestamp ?? DateTime.now(),
queuedAt = queuedAt ?? timestamp ?? DateTime.now();