WorkerResponseImpl extension
Class used to communicate from a Worker to clients.
WorkerResponses are used to provide individual results to the client. Future-based services simply return a
single WorkerResponse with the result. Streaming services will return one WorkerResponses for each stream
item and mmust send a WorkerResponseImpl.closeStream message to indicate completion. WorkerResponses can also
send error messages.
Extension methods operating on a List
as a WorkerResponse. WorkerResponse is used to provide individual
results to the client. Future-based services simply return a single WorkerResponse with the result. Stream
services return one WorkerResponse for each stream item and mmust send a WorkerResponseImpl.closeStream
message to indicate completion. A WorkerResponse can also be used to send error messages.
Properties
- endOfStream → bool
-
Available on WorkerResponse, provided by the WorkerResponseImpl extension
Flag indicating the end of the Streaming operation.no setter - error → SquadronException?
-
Available on WorkerResponse, provided by the WorkerResponseImpl extension
The WorkerResponse exception, if any.no setter - result → dynamic
-
Available on WorkerResponse, provided by the WorkerResponseImpl extension
Retrieves the result associated to this WorkerResponse. If the WorkerResponse contains an error, an the error exception is thrown.no setter
Static Methods
-
closeStream(
) → WorkerResponse -
Available on WorkerResponse, provided by the WorkerResponseImpl extension
Special WorkerResponse message to indicate the end of a stream. -
log(
String message) → WorkerResponse -
Available on WorkerResponse, provided by the WorkerResponseImpl extension
WorkerResponse with an error message and an optional (string) StackTrace. -
withError(
Object exception, [StackTrace? stackTrace]) → WorkerResponse -
Available on WorkerResponse, provided by the WorkerResponseImpl extension
WorkerResponse with an error message and an optional (string) StackTrace. -
withResult(
dynamic result) → WorkerResponse -
Available on WorkerResponse, provided by the WorkerResponseImpl extension
WorkerResponse with a validresult
. Ifresult
is anIterable
but not aList
, it will be converted to aList
by callingtoList()
.