LevitTaskEvent constructor

LevitTaskEvent({
  1. required LevitTaskEventType type,
  2. required String taskId,
  3. String? executionId,
  4. String ownerPath = '?',
  5. LevitTaskPhase? phase,
  6. LevitTaskMetadata? metadata,
  7. TaskPriority priority = TaskPriority.normal,
  8. int attempt = 0,
  9. int maxRetries = 0,
  10. DateTime? queuedAt,
  11. DateTime? startedAt,
  12. DateTime? finishedAt,
  13. Duration? queueDuration,
  14. Duration? runDuration,
  15. Duration? retryIn,
  16. double? progress,
  17. TaskSkipReason? skipReason,
  18. LevitTaskOutcome? outcome,
  19. Object? error,
  20. StackTrace? stackTrace,
  21. bool? runsInIsolate,
  22. bool? runInIsolate,
  23. String? debugName,
  24. 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();