ThrowingSupplier
This commit is contained in:
parent
d169c1277b
commit
a319245fa5
|
@ -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(
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package org.syndicate_lang.actors;
|
||||
|
||||
public interface ThrowingSupplier<T> {
|
||||
public T get() throws Throwable;
|
||||
}
|
Loading…
Reference in New Issue