DVCompositeHttpTransport class

Routes each protocol to whichever transport can speak it.

Exists so a faster transport can arrive one protocol at a time. A native HTTP/2 client is useful the day it works, and should not have to reimplement HTTP/1.1 first just to avoid regressing requests that fall back — this sends HTTP/2 to the native client and HTTP/1.1 to package:http, and the fallback walk cannot tell the difference.

Later entries never shadow earlier ones: the first transport that claims a protocol owns it, so registering a native client ahead of the default is enough to take over exactly what it supports.

Implemented types

Constructors

DVCompositeHttpTransport(List<DVHttpTransport> transports)

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
A name for diagnostics: package:http, rust, fetch.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedProtocols Set<DVHttpProtocol>
Protocols this transport can actually speak here — which depends on the platform, not only on the implementation.
no setteroverride
transports List<DVHttpTransport>
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(DVHttpRequest request) Future<DVHttpResponse>
Sends request, which is already pinned to a single protocol.
override
stream(DVHttpRequest request) Future<DVHttpStreamedResponse>
Sends request and yields the body as it arrives.
override
toString() String
A string representation of this object.
inherited
transportFor(DVHttpProtocol protocol) DVHttpTransport?
The transport that owns protocol, or null when none claims it.

Operators

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