toMetaJson method

  1. @override
Map<String, dynamic> toMetaJson()
override

Serializes the queue job into a metadata-oriented JSON map.

Includes the database id, queue status, UUID, timestamps, payload, and derived payload hash.

Example:

final meta = job.toMetaJson();
print(meta['status']);
print(meta['hash']);

Implementation

@override
Map<String, dynamic> toMetaJson() {
  return {
    'id': id,
    'status': status.name,
    'uuid': uuid,
    'created_at': createdAt?.toIso8601String(),
    'updated_at': updatedAt?.toIso8601String(),
    'payload': jsonEncode(payload),
    'hash': hash,
  };
}