TaskWorker<I extends Object, R, U> class base

A WorkerTask on its own isolate. Requests run in call order, a stream stops delivering when its listener cancels, and dispose closes the task after every request accepted before it. Once the worker fails, every request fails with that error.

Constructors

TaskWorker(String _name, [void _onFailure(MediaPipeException error)?])
A worker for one task, which its errors name, such as 'DecisionMaker'; the optional callback hears the worker's failure as it happens.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → Future<void>
Closes the task after every accepted request, then waits for the worker to exit. Repeated calls return the same completion.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(I input) → Future<R>
Runs input after every request before it.
start<O>(O options, WorkerTask<I, R, U> create(O)) → Future<void>
Spawns the worker, where create makes the task from options, and completes once the task exists or with what kept it from existing. create must be sendable: a top-level function or a constructor tear-off.
stream(I input) → Stream<U>
Streams input's updates once listened to; cancelling stops delivery and waits for the worker to finish the request.
toString() → String
A string representation of this object.
inherited

Operators

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