WorkerMessage<T, R> class
abstract
Defines the base class for messages sent to isolates for execution.
This file provides the WorkerMessage abstract class, which represents a unit of work that can be sent to an IsolateWorker for execution in a separate isolate. Subclass this to define custom tasks with input and output types. Represents a unit of work to be executed in an isolate.
Extend this class to define the input (T) and result (R) types for your task.
Implement the execute method to perform the computation.
Constructors
- WorkerMessage(String? id, T input)
Properties
Methods
-
execute(
) → FutureOr< R> -
Method to execute the task, return the result of type
R. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited