Timeout class
Specifies timeout for read requests.
Use this to limit how long the read takes on the server side. If a read request doesn't finish within the allotted time, it terminates with an HTTP 400 error. This is particularly useful when you expect a small data transfer and don't want to wait too long to fetch a potentially huge subtree. Actual read time might vary based on data size and caching.
Note: The maximum timeout is 15 minutes.
- Annotations
-
- @freezed
Constructors
- Timeout.fromDuration(Duration duration)
-
Creates a timeout from a Duration object.
factory
- Timeout.min(int value)
-
Creates a timeout with a minutes resolution for
value
constfactory - Timeout.ms(int value)
-
Creates a timeout with a milliseconds resolution for
value
constfactory - Timeout.s(int value)
-
Creates a timeout with a seconds resolution for
value
constfactory
Properties
-
copyWith
→ $TimeoutCopyWith<
Timeout> -
no setterinherited
- duration → Duration
-
Converts the timeout to a Duration with the same time value.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → int
-
The integer value of the timeout.
no setter
Methods
-
map<
TResult extends Object?> ({required TResult ms(_TimeoutMs value), required TResult s(_TimeoutS value), required TResult min(_TimeoutMin value)}) → TResult -
inherited
-
maybeMap<
TResult extends Object?> ({TResult ms(_TimeoutMs value)?, TResult s(_TimeoutS value)?, TResult min(_TimeoutMin value)?, required TResult orElse()}) → TResult -
inherited
-
maybeWhen<
TResult extends Object?> ({TResult ms(int value)?, TResult s(int value)?, TResult min(int value)?, required TResult orElse()}) → TResult -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
when<
TResult extends Object?> ({required TResult ms(int value), required TResult s(int value), required TResult min(int value)}) → TResult -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited