ThrowingSupplier

This commit is contained in:
Tony Garnock-Jones 2020-12-07 23:52:16 +01:00
parent d169c1277b
commit a319245fa5
3 changed files with 7 additions and 2 deletions

View File

@ -58,7 +58,7 @@ public class Actor implements Executor {
return new Actor().proxyFor(o);
}
public static<T> Promise<Remote<T>> boot(Supplier<T> f) {
public static<T> Promise<Remote<T>> boot(ThrowingSupplier<T> f) {
Promise<Remote<T>> p = new Promise<>();
Actor a = new Actor();
a.execute(

View File

@ -117,7 +117,7 @@ public class Promise<T> implements Future<T> {
return this.andThen(ok, null);
}
public void resolveCalling(Supplier<T> f) {
public void resolveCalling(ThrowingSupplier<T> f) {
try {
this.resolveWith(f.get());
} catch (Throwable e) {

View File

@ -0,0 +1,5 @@
package org.syndicate_lang.actors;
public interface ThrowingSupplier<T> {
public T get() throws Throwable;
}