Request options
Generated reference for ovok_sdk: request options.
- Stable unknown
- Release candidate not available
- Development since 0.2.0-dev.51+80996d9
CancelToken
class CancelTokenEnds the requests that carry it; the Dart counterpart of an AbortSignal.
Constructors
CancelToken.new
CancelToken()Properties
CancelToken.isCancelled
bool get isCancelledWhether cancel has been called.
CancelToken.whenCancelled
Future<Object?> get whenCancelledCompletes with the reason given to cancel.
Methods
CancelToken.cancel
void cancel([Object? reason])Aborts every request carrying this token; later calls change nothing.
| Parameter | Type | Kind | Default |
|---|---|---|---|
reason | Object? | optional positional |
Returns void.
RequestOptions
class RequestOptionsPer-request limits, accepted by every network method that has them.
Constructors
RequestOptions.new
RequestOptions({Duration? timeout, CancelToken? cancelToken})Limits one exchange to timeout and ends it when cancelToken is cancelled.
| Parameter | Type | Kind | Default |
|---|---|---|---|
timeout | Duration? | named | |
cancelToken | CancelToken? | named |
Properties
RequestOptions.timeout
final Duration? timeoutReplaces the client's timeout for each exchange of the request.
RequestOptions.cancelToken
final CancelToken? cancelTokenCancelling it throws OvokCancelledException, and the request is not retried.
Last updated on