You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current play-services integration provides Task.await that allows waiting for the result of an already created Task. This function supports cancellation, but not in both directions: If await is cancelled, then the underlying Task is not cancelled.
…Kotlin#2786)
* Support bi-directional cancellation for Task.asDeferred and Task.await via passed in CancellationTokenSource
FixesKotlin#2527
Co-authored-by: Alex Vanyo <vanyoalex@gmail.com>
Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com>
The current
play-services
integration providesTask.await
that allows waiting for the result of an already createdTask
. This function supports cancellation, but not in both directions: Ifawait
is cancelled, then the underlyingTask
is not cancelled.Some methods of creating
Task
s don't support cancellation in this manner, but some do by creating the task with aCancellationToken
. For an example: https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/FindAutocompletePredictionsRequest.Builder#setCancellationToken(com.google.android.gms.tasks.CancellationToken)My proposal is to add another
await
method, that operates on a lambda that constructs aTask
given aCancellationToken
.The text was updated successfully, but these errors were encountered: