protected interface ProvideError {
Exception getError();
}
This interface public
Allowing it to be public, you could then create Kotlin extension on the highest generic upper bound of StorageTask like:
fun Continuation<Unit>.resume(): Unit =
resumeWith(Result.success(Unit))
suspend fun <T : StorageTask.ProvideError> StorageTask<T>.await() = suspendCancellableCoroutine<Unit> { cont ->
val l = OnCompleteListener<T> { cont.resume() }
addOnCompleteListener(l)
cont.invokeOnCancellation { removeOnCompleteListener(l) }
}
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Thank you for sending this feature request. We will keep this FR open and update it as we prioritize new features. Thank you.
I will look at this soon, but this requires some "paperwork" on our end since it modifies the Public API.
Most helpful comment
Thank you for sending this feature request. We will keep this FR open and update it as we prioritize new features. Thank you.