QueueJob class
Persistent queue record for jobs dispatched through Queueable.
A QueueJob stores the serialized payload, derived payload hash, and
execution status used by the queue system.
Example:
final job = QueueJob.fromJson({
'status': 'created',
'payload': '{"_name":"SendWelcomeEmail","email":"jane@example.com"}',
});
print(job.status.name); // created
- Inheritance
- Mixed-in types
- Available extensions
Constructors
-
QueueJob.fromJson(Map<
String, dynamic> json) - Creates a queue job model from persisted JSON.
Properties
- createdAt ↔ DateTime?
-
Creation timestamp (UTC).
getter/setter pairinherited
- disk ↔ DatabaseDisk
-
getter/setter pairinherited
- hash → String
-
Returns the SHA-256 hash of the serialized payload.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ int?
-
Primary key (auto-incremented by backend).
getter/setter pairinherited
-
payload
↔ Map<
String, dynamic> -
Decoded payload originally stored for the job.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ QueueJobStatus
-
Current queue status for the job.
getter/setter pair
- updatedAt ↔ DateTime?
-
Last update timestamp (UTC).
getter/setter pairinherited
- uuid ↔ String?
-
UUID for cross-backend identification.
getter/setter pairinherited
Methods
-
attach(
Model sibling, {required ModelRelationshipType relationship, PivotTable< Model, Model> ? table, DatabaseDisk disk = Model.defaultDisk}) → Future<bool> -
Available on Model, provided by the ModelRelationshipOps extension
Attachessiblingto this model using the givenrelationshiptype. -
belongsToMany<
T extends Model> ({required PivotTable< Model, Model> table, DatabaseDisk disk = Model.defaultDisk}) → Future<List< T> > -
Available on Model, provided by the ModelRelationships extension
Resolves many-to-many related models through a pivot table. -
belongsToOne<
T extends Model> ({DatabaseDisk disk = Model.defaultDisk}) → Future< T?> -
Available on Model, provided by the ModelRelationships extension
Resolves the parent model for an inverse relationship. -
delete(
{DatabaseDisk? disk}) → Future< bool> -
Deletes the current instance.
inherited
-
detach(
Model sibling, {required ModelRelationshipType relationship, PivotTable< Model, Model> ? table, DatabaseDisk disk = Model.defaultDisk}) → Future<bool> -
Available on Model, provided by the ModelRelationshipOps extension
Detachessiblingfrom this model using the givenrelationshiptype. -
getInstanceTableName(
) → String -
inherited
-
getInstanceTableSingularName(
) → String -
inherited
-
hasMany<
T extends Model> ({DatabaseDisk disk = Model.defaultDisk}) → Future< List< T> > -
Available on Model, provided by the ModelRelationships extension
Resolves all one-to-many related models. -
hasOne<
T extends Model> ({DatabaseDisk disk = Model.defaultDisk}) → Future< T?> -
Available on Model, provided by the ModelRelationships extension
Resolves a one-to-one related model. -
load<
T extends Model> (ModelRelationshipType relationship, {PivotTable< Model, Model> ? table}) → Future<Map< String, dynamic> > -
Available on Model, provided by the ModelRelationshipOps extension
Loads a relationship and returns this model serialized with the related data embedded. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
{DatabaseDisk? disk}) → Future< bool> -
Saves the current instance.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes the queue job into its standard JSON representation.
override
-
toMetaJson(
) → Map< String, dynamic> -
Serializes the queue job into a metadata-oriented JSON map.
override
-
toString(
) → String -
Human-readable string representation.
inherited
-
update(
{required Map< String, dynamic> withJson, DatabaseDisk? disk}) → Future<bool> -
Updates the current instance with new data.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
columnDefinitions
↔ Map<
String, String> -
Database column definitions for persisted queue jobs.
getter/setter pair
Static Methods
-
inline(
IsolateJob job, [App? app]) → Future - Executes a standalone async job inside a fresh isolate and returns its result.