Created
September 25, 2024 14:30
-
-
Save yanok/b3c3dcb0a0b6ae9209e3efd977002898 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std; | |
struct notrace {} | |
struct string_tracetail { | |
string value; | |
alias value this; | |
} | |
class ReactorFiber{ | |
string_tracetail funcName; | |
@notrace setCallback(alias F)() { | |
funcName = fullyQualifiedName!F; | |
} | |
} | |
struct FiberHandle { | |
} | |
struct Reactor { | |
ReactorFiber allocFiber() { | |
return new ReactorFiber; | |
} | |
FiberHandle spawnFiber(alias F)() { | |
auto fib = allocFiber; | |
fib.setCallback!F; | |
return FiberHandle(); | |
} | |
} | |
Reactor theReactor; | |
void closure(void delegate() ) { | |
} | |
unittest | |
{ | |
closure({ | |
static f() {} | |
theReactor.spawnFiber!f; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment