FusedTransformer class

A Transformer that has a fast path for decoding UTF8-encoded JSON. If the response is utf8-encoded JSON and no custom decoder is specified in the RequestOptions, this transformer is significantly faster than the default SyncTransformer and the BackgroundTransformer. This improvement is achieved by using a fused Utf8Decoder and JsonDecoder to decode the response, which is faster than decoding the utf8-encoded JSON in two separate steps, since Dart uses a special fast decoder for this case. See https://github.com/dart-lang/sdk/blob/5b2ea0c7a227d91c691d2ff8cbbeb5f7f86afdb9/sdk/lib/_internal/vm/lib/convert_patch.dart#L40

By default, this transformer will transform responses in the main isolate, but a custom threshold can be set to switch to an isolate for large responses by passing contentLengthIsolateThreshold.

Inheritance

Constructors

FusedTransformer({int contentLengthIsolateThreshold = -1})
FusedTransformer.sync()
Always decode the response in the same isolate
factory

Properties

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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
transformRequest(RequestOptions options) Future<String>
transformRequest allows changes to the request data before it is sent to the server, but after the RequestInterceptor.
override
transformResponse(RequestOptions options, ResponseBody responseBody) Future
transformResponse allows changes to the response data before it is passed to ResponseInterceptor.
override

Operators

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