1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-12 13:33:57 +00:00

Working TCP echo server and client.

Required a few changes to APIs, namely janet_root_fiber()
to get topmost fiber that is active in the current scheduler.
This is distinct from janet_current_fiber(), which gets the bottom
most fiber in the fiber stack - it might have a parent, and so cannot
be reliably resumed.
This is the kind of situation that makes symmetric coroutines more
attractive.
This commit is contained in:
Calvin Rose
2020-02-09 19:04:34 -06:00
parent 7f1f684b21
commit f4d7fd97f6
11 changed files with 341 additions and 92 deletions

View File

@@ -337,6 +337,10 @@ JanetFiber *janet_current_fiber(void) {
return janet_vm_fiber;
}
JanetFiber *janet_root_fiber(void) {
return janet_vm_root_fiber;
}
/* CFuns */
static Janet cfun_fiber_getenv(int32_t argc, Janet *argv) {