Thread class abstract

An abstract class representing a thread (isolate) used for processing tasks.

This class provides the structure for managing tasks within an isolate, including initializing the isolate, sending data to the isolate, and destroying active tasks.

Implementers

Constructors

Thread({required dynamic onMessage(ThreadResponse)})
Constructs a Thread with the given onMessage callback.

Properties

activeTaskIds List<String>
List of IDs of tasks currently being processed by the isolate.
getter/setter pair
activeTasks int
Number of active tasks currently being processed by the isolate.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
A unique id for this thread.
getter/setter pair
isReady bool
Indicates whether the thread is ready for communication.
getter/setter pair
onMessage → dynamic Function(ThreadResponse)
Callback function for handling messages received from the isolate.
final
readyState Completer
A completer to track when the thread is ready for communication.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() → void
Destroys the thread and cleans up any resources.
destroyActiveTasks(String ignoreTaskId) → void
Destroys all active tasks in the thread, except the task with the given ignoreTaskId.
init() → void
Initializes the thread.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(ThreadRequest data) → void
Sends a ThreadRequest to the thread for processing.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited