-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
Use case
In addition to the experimental Deferred<T>::getCompleted and Deferred<T>::getCompletionExceptionOrNull, it would be very useful to have getCompletedOrNull as a way to reduce this snippet.
if (deferred.isCompleted) {
deferred.getCompleted()
} else {
null
}This way, it would be trivial to get an awaitable value from synchronous code and cleaner than the above snippet, or catching the IllegalState thrown by getCompleted
Reactions are currently unavailable