Browse Source

ThrowingSupplier

main
Tony Garnock-Jones 11 months ago
parent
commit
a319245fa5
  1. 2
      src/main/java/org/syndicate_lang/actors/Actor.java
  2. 2
      src/main/java/org/syndicate_lang/actors/Promise.java
  3. 5
      src/main/java/org/syndicate_lang/actors/ThrowingSupplier.java

2
src/main/java/org/syndicate_lang/actors/Actor.java

@ -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(

2
src/main/java/org/syndicate_lang/actors/Promise.java

@ -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) {

5
src/main/java/org/syndicate_lang/actors/ThrowingSupplier.java

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