cleanup: remove Promise.wrap

This commit is contained in:
Vladimir Krivosheev
2016-09-16 10:28:45 +02:00
parent 56d4fe4794
commit 846bc3fbed
@@ -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);