Worker class abstract

Base worker class.

This base class takes care of creating the Channel and firing up the worker. Typically, derived classes should add proxy methods sending WorkerRequests to the worker.

Implemented types

Constructors

Worker(dynamic _entryPoint, {List args = const [], PlatformWorkerHook? platformWorkerHook})
Creates a Worker with the specified entrypoint.

Properties

args List
The Worker's start arguments.
final
channel Channel?
Channel to communicate with the worker.
no setter
hashCode int
The hash code for this object.
no setterinherited
idleTime Duration
Idle time.
no setter
isStopped bool
Indicates if the Worker has been stopped.
no setter
maxWorkload int
Maximum acceptable workload.
no setter
operations Map<int, CommandHandler>
Workers do not need an operations map.
no setteroverride
platformWorkerHook PlatformWorkerHook?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stats WorkerStat
Worker statistics.
no setter
status String
Worker status.
no setter
totalErrors int
Total errors.
no setter
totalWorkload int
Total processed workload.
no setter
upTime Duration
Up time.
no setter
workerId String
Worker ID
final
workload int
Current workload.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send<T>(int command, {List args = const [], CancellationToken? token, bool inspectRequest = false, bool inspectResponse = false}) Future<T>
Sends a workload to the worker.
start() Future<Channel>
Creates a Channel and starts the worker using the _entryPoint.
stop() → void
Stops this worker.
stream<T>(int command, {List args = const [], CancellationToken? token, bool inspectRequest = false, bool inspectResponse = false}) Stream<T>
Sends a streaming workload to the worker.
toString() String
A string representation of this object.
inherited

Operators

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