mirror of
https://github.com/ParkerTenBroeck/coroutines.git
synced 2026-06-06 21:00:35 -04:00
moved to coroutines package
This commit is contained in:
parent
1c0430cfac
commit
3c59263a55
37 changed files with 85 additions and 88 deletions
|
|
@ -1,7 +1,4 @@
|
|||
package basic;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
|
||||
public class Futures {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package basic;
|
||||
|
||||
import com.parkertenbroeck.generator.Gen;
|
||||
import com.parkertenbroeck.coroutines.generator.Gen;
|
||||
|
||||
public class Gens {
|
||||
public static Gen<Long, Void> primes(){
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package basic;
|
||||
|
||||
import com.parkertenbroeck.bcsm.RT;
|
||||
import com.parkertenbroeck.bcsm.loadtime.CoroutineClassLoader;
|
||||
import com.parkertenbroeck.generator.Gen;
|
||||
import com.parkertenbroeck.coroutines.bcsm.RT;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.CoroutineClassLoader;
|
||||
import com.parkertenbroeck.coroutines.generator.Gen;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package lexer;
|
||||
|
||||
import com.parkertenbroeck.generator.Gen;
|
||||
import com.parkertenbroeck.coroutines.generator.Gen;
|
||||
|
||||
public class Lexer {
|
||||
public sealed interface Token{}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package lexer;
|
||||
|
||||
import com.parkertenbroeck.generator.Gen;
|
||||
import com.parkertenbroeck.bcsm.RT;
|
||||
import com.parkertenbroeck.bcsm.loadtime.CoroutineClassLoader;
|
||||
import com.parkertenbroeck.coroutines.generator.Gen;
|
||||
import com.parkertenbroeck.coroutines.bcsm.RT;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.CoroutineClassLoader;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package sockets;
|
||||
|
||||
import com.parkertenbroeck.async_runtime.Jokio;
|
||||
import com.parkertenbroeck.bcsm.RT;
|
||||
import com.parkertenbroeck.bcsm.loadtime.CoroutineClassLoader;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.Jokio;
|
||||
import com.parkertenbroeck.coroutines.bcsm.RT;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.CoroutineClassLoader;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
package sockets;
|
||||
|
||||
import com.parkertenbroeck.async_runtime.Delay;
|
||||
import com.parkertenbroeck.async_runtime.Jokio;
|
||||
import com.parkertenbroeck.async_runtime.io.net.ServerSocket;
|
||||
import com.parkertenbroeck.async_runtime.io.net.Socket;
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.bcsm.loadtime.future.Cancellation;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.Delay;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.Jokio;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.net.ServerSocket;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.net.Socket;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.future.Cancellation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
version = "0.1.0"
|
||||
group = "com.parkertenbroeck.generators"
|
||||
group = "com.parkertenbroeck.coroutines"
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.async_runtime;
|
||||
package com.parkertenbroeck.coroutines.async_runtime;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.parkertenbroeck.async_runtime;
|
||||
package com.parkertenbroeck.coroutines.async_runtime;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Waker;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.parkertenbroeck.async_runtime;
|
||||
package com.parkertenbroeck.coroutines.async_runtime;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Waker;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.HashSet;
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
package com.parkertenbroeck.async_runtime;
|
||||
package com.parkertenbroeck.coroutines.async_runtime;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class Util {
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.parkertenbroeck.async_runtime.io;
|
||||
package com.parkertenbroeck.coroutines.async_runtime.io;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.async_runtime.io;
|
||||
package com.parkertenbroeck.coroutines.async_runtime.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.*;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.parkertenbroeck.async_runtime.io;
|
||||
package com.parkertenbroeck.coroutines.async_runtime.io;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.parkertenbroeck.async_runtime.io.fs;
|
||||
package com.parkertenbroeck.coroutines.async_runtime.io.fs;
|
||||
|
||||
import com.parkertenbroeck.async_runtime.io.Readable;
|
||||
import com.parkertenbroeck.async_runtime.io.Writable;
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.Readable;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.Writable;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Waker;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package com.parkertenbroeck.async_runtime.io.net;
|
||||
package com.parkertenbroeck.coroutines.async_runtime.io.net;
|
||||
|
||||
import com.parkertenbroeck.async_runtime.io.Readable;
|
||||
import com.parkertenbroeck.async_runtime.io.SelectorThread;
|
||||
import com.parkertenbroeck.async_runtime.io.Writable;
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.Readable;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.SelectorThread;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.Writable;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Waker;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.parkertenbroeck.async_runtime.io.net;
|
||||
package com.parkertenbroeck.coroutines.async_runtime.io.net;
|
||||
|
||||
import com.parkertenbroeck.async_runtime.io.SelectorThread;
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.SelectorThread;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Waker;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package com.parkertenbroeck.async_runtime.io.net;
|
||||
package com.parkertenbroeck.coroutines.async_runtime.io.net;
|
||||
|
||||
import com.parkertenbroeck.async_runtime.io.Readable;
|
||||
import com.parkertenbroeck.async_runtime.io.SelectorThread;
|
||||
import com.parkertenbroeck.async_runtime.io.Writable;
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.Readable;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.SelectorThread;
|
||||
import com.parkertenbroeck.coroutines.async_runtime.io.Writable;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Waker;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.parkertenbroeck.bcsm;
|
||||
package com.parkertenbroeck.coroutines.bcsm;
|
||||
|
||||
|
||||
import com.parkertenbroeck.bcsm.loadtime.CoroutineClassLoader;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.CoroutineClassLoader;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Set;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.classfile.*;
|
||||
import java.lang.classfile.attribute.InnerClassInfo;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.generator.Gen;
|
||||
import com.parkertenbroeck.bcsm.loadtime.future.FutureSMBuilder;
|
||||
import com.parkertenbroeck.bcsm.loadtime.gen.GenSMBuilder;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.generator.Gen;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.future.FutureSMBuilder;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.gen.GenSMBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.classfile.*;
|
||||
|
|
@ -33,7 +33,7 @@ public class CoroutineClassLoader extends ClassLoader {
|
|||
}
|
||||
public static Config builtin(){
|
||||
return empty()
|
||||
.skip("java", "jdk", "jre", "com.parkertenbroeck.bcsm.loadtime")
|
||||
.skip("java", "jdk", "jre", "com.parkertenbroeck.coroutines.bcsm.loadtime")
|
||||
.with(Future.class, FutureSMBuilder::new)
|
||||
.with(Gen.class, GenSMBuilder::new);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.classfile.CodeBuilder;
|
||||
import java.lang.classfile.instruction.LineNumber;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.classfile.*;
|
||||
import java.lang.classfile.attribute.RuntimeInvisibleTypeAnnotationsAttribute;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.constant.ClassDesc;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
public enum ReplacementKind {
|
||||
ImmediateReplacingPop,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.classfile.CodeBuilder;
|
||||
import java.lang.classfile.TypeKind;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.constant.ClassDesc;
|
||||
import java.lang.constant.MethodTypeDesc;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.classfile.CodeBuilder;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.classfile.CodeBuilder;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime;
|
||||
|
||||
import java.lang.classfile.CodeBuilder;
|
||||
import java.lang.classfile.Label;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime.future;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime.future;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime.future;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime.future;
|
||||
|
||||
import com.parkertenbroeck.future.Future;
|
||||
import com.parkertenbroeck.future.Waker;
|
||||
import com.parkertenbroeck.bcsm.loadtime.*;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.*;
|
||||
import com.parkertenbroeck.coroutines.future.Future;
|
||||
import com.parkertenbroeck.coroutines.future.Waker;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.*;
|
||||
|
||||
import java.lang.classfile.*;
|
||||
import java.lang.classfile.instruction.SwitchCase;
|
||||
|
|
@ -26,7 +27,7 @@ public class FutureSMBuilder extends CoroutineBuilder<FutureSMBuilder> {
|
|||
|
||||
private final HashMap<Integer, Consumer<CodeBuilder>> cancellation_behavior = new HashMap<>();
|
||||
|
||||
static class AwaitHandler implements SpecialMethodHandler<FutureSMBuilder>{
|
||||
static class AwaitHandler implements SpecialMethodHandler<FutureSMBuilder> {
|
||||
final StateBuilder.State awaiting;
|
||||
final Label save_label;
|
||||
final Label resume_inline;
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
package com.parkertenbroeck.bcsm.loadtime.gen;
|
||||
package com.parkertenbroeck.coroutines.bcsm.loadtime.gen;
|
||||
|
||||
import com.parkertenbroeck.generator.Gen;
|
||||
import com.parkertenbroeck.bcsm.loadtime.*;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.*;
|
||||
import com.parkertenbroeck.coroutines.generator.Gen;
|
||||
import com.parkertenbroeck.coroutines.bcsm.loadtime.*;
|
||||
|
||||
import java.lang.classfile.*;
|
||||
import java.lang.constant.ClassDesc;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.future;
|
||||
package com.parkertenbroeck.coroutines.future;
|
||||
|
||||
public interface Future<R, E extends Throwable> {
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.future;
|
||||
package com.parkertenbroeck.coroutines.future;
|
||||
|
||||
public interface Waker {
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.parkertenbroeck.generator;
|
||||
package com.parkertenbroeck.coroutines.generator;
|
||||
|
||||
public interface Gen<Y, R> {
|
||||
Res<Y, R> next();
|
||||
Loading…
Add table
Add a link
Reference in a new issue