kin-android / org.kin.sdk.base.tools / NetworkOperation
data class NetworkOperation<ResponseType>
onCompleted
-
id
-
timeout
-
backoffStrategy
-
callback
-
Name | Summary |
---|---|
State | sealed class State |
| Name | Summary |
|—|—|
| <init> | NetworkOperation(onSuccess: (ResponseType) ->
Unit
, onError: ((
Throwable
) ->
Unit
)? = null, id:
String
= generateRandomId(), timeout:
Long
= DEFAULT_TIMEOUT, backoffStrategy:
BackoffStrategy
= BackoffStrategy.Exponential(
maximumWaitTime = timeout
), callback: (
PromisedCallback
<ResponseType>) ->
Unit
)
NetworkOperation(onCompleted:
PromisedCallback
<ResponseType>, id:
String
= generateRandomId(), timeout:
Long
= DEFAULT_TIMEOUT, backoffStrategy:
BackoffStrategy
= BackoffStrategy.Exponential(
maximumWaitTime = timeout
), callback: (
PromisedCallback
<ResponseType>) ->
Unit
)
|
Name | Summary |
---|---|
backoffStrategy | <ul><li>the strategy used to retry a task that fails</li></ul>val backoffStrategy: BackoffStrategy |
callback | <ul><li>the work performed by the operation</li></ul>val callback: ( PromisedCallback <ResponseType>) -> Unit |
expiryFuture | var expiryFuture: ScheduledFuture <*>? |
id | <ul><li>a unique identifier for the operation</li></ul>val id: String |
onCompleted | <ul><li>will be called when the operation has completed, successfully or with an error (including if it timed out, or failed fatally)</li></ul>val onCompleted: PromisedCallback <ResponseType> |
state | var state: State |
timeout | <ul><li>task will timeout in milliseconds, if not completed within the timeout period, with NetworkOperationsHandlerException.OperationTimeoutException</li></ul>val timeout: Long |
Name | Summary |
---|---|
generateRandomId | fun generateRandomId(): String |