UpdatingClient class Null safety

Automatically updates the underlying client after the specified use limits.

Implemented types

Constructors

UpdatingClient({required CreateClientFn createClientFn, CloseClientFn? closeClientFn, int requestLimit = 1000, Duration timeLimit = const Duration(hours: 1), bool invalidateOnError = false, bool forceCloseOnError = false})

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

close({bool force = false}) Future
Closes any HTTP Client resources.
override
expireCurrent({bool force = false}) → void
Marks the currently active client as expired, next calls should trigger a new client creation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
send(Request request) Future<Response>
Sends the request and returns the Response
override
toString() String
A string representation of this object.
inherited
withClient<R>(Future<R> fn(TrackingClient client), {bool invalidateOnError = false, bool forceCloseOnError = false}) Future<R>
Runs a function with a TrackingClient as parameter and handles invalidation on exceptions.

Operators

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