ThrowingSupplier
This commit is contained in:
parent
d169c1277b
commit
a319245fa5
|
@ -58,7 +58,7 @@ public class Actor implements Executor {
|
||||||
return new Actor().proxyFor(o);
|
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<>();
|
Promise<Remote<T>> p = new Promise<>();
|
||||||
Actor a = new Actor();
|
Actor a = new Actor();
|
||||||
a.execute(
|
a.execute(
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class Promise<T> implements Future<T> {
|
||||||
return this.andThen(ok, null);
|
return this.andThen(ok, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resolveCalling(Supplier<T> f) {
|
public void resolveCalling(ThrowingSupplier<T> f) {
|
||||||
try {
|
try {
|
||||||
this.resolveWith(f.get());
|
this.resolveWith(f.get());
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package org.syndicate_lang.actors;
|
||||||
|
|
||||||
|
public interface ThrowingSupplier<T> {
|
||||||
|
public T get() throws Throwable;
|
||||||
|
}
|
Loading…
Reference in New Issue