organized, added futures

This commit is contained in:
ParkerTenBroeck 2025-04-25 13:25:03 -04:00
parent 13d9ba7363
commit 6424548e75
8 changed files with 29 additions and 6 deletions

View file

@ -0,0 +1,18 @@
package generator.future;
public interface Future<R> {
@SuppressWarnings("unchecked")
default R poll(Waker waker){
return (R) Pending.INSTANCE;
}
default R await(){
throw new RuntimeException();
}
final class Pending{
private static final Pending INSTANCE = new Pending();
private Pending(){}
}
}