mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup: remove Promise.wrap
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.jetbrains.concurrency;
|
||||
|
||||
import com.intellij.openapi.util.AsyncResult;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.Function;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -42,13 +41,6 @@ public interface Promise<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static <T> Promise<T> wrap(@NotNull AsyncResult<T> asyncResult) {
|
||||
final AsyncPromise<T> promise = new AsyncPromise<>();
|
||||
asyncResult.doWhenDone((Consumer<T>)result -> promise.setResult(result)).doWhenRejected(promise::setError);
|
||||
return promise;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
Promise<T> done(@NotNull Consumer<? super T> done);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user