WorkerChannel class abstract
A WorkerChannel supports communication from a platform worker to the client that posted the WorkerRequest. It is used to send WorkerResponse back to the client.
Constructors
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
-
canStream(
Stream stream) → bool -
Checks if
stream
can be streamed back to the worker client. -
closeStream(
) → void -
Sends a
WorkerResponse.closeStream
to the worker client. This method must be called from the worker only. -
connect(
Object channelInfo) → void -
Connects the Channel with the Squadron Worker.
channelInfo
is an opaque object than can be deserialized as a Channel. This method must be called by the worker upon startup. -
error(
SquadronException error) → void - Sends a WorkerResponse with the specified error to the worker client. This method must be called from the worker only.
-
inspectAndReply(
dynamic data) → void - Sends a WorkerResponse with the specified data to the worker client. This method must be called from the worker only. On Web patforms, this version must check arguments for transferable objects.
-
log(
String message) → void -
Sends a
WorkerResponse.log
with the specified data to the worker client. This method must be called from the worker only. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reply(
dynamic data) → void - Sends a WorkerResponse with the specified data to the worker client. This method must be called from the worker only. On Web patforms, this version does not check arguments for transferable objects.
-
serialize(
) → dynamic - WorkerChannel serialization. Returns an opaque object that can be transfered from the client to the worker.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
deserialize(
dynamic channelInfo) → WorkerChannel? -
Deserializes a Channel from an opaque
channelInfo
.