Skip to content

Instantly share code, notes, and snippets.

@cdsap
Last active April 18, 2018 11:55
Show Gist options
  • Save cdsap/14aaddf882f22b015af1f556b62b50c9 to your computer and use it in GitHub Desktop.
Save cdsap/14aaddf882f22b015af1f556b62b50c9 to your computer and use it in GitHub Desktop.
class CallWrapper(private val request: Request, private var executed: Boolean = false,
private var cancelled: Boolean = false) : Call {
override fun enqueue(responseCallback: Callback?) {}
override fun isExecuted() = executed
override fun clone() = CallWrapper(request)
override fun isCanceled() = cancelled
override fun cancel() {
cancelled = true
}
override fun request() = request
override fun execute(): Response { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment