Invert event loop
This commit is contained in:
+15
-1
@@ -10,7 +10,15 @@
|
||||
// str.h strings and the string natives
|
||||
// number.h the number natives
|
||||
// any.h any_t and JS's operators on it
|
||||
// io.h IO natives, async on io_uring (uring.h)
|
||||
// io.h IO natives, async on io_uring (uring.h), and the host's loop
|
||||
//
|
||||
// The host owns the event loop. The program exports two fns, which the host
|
||||
// calls, and a flavor of the runtime is the host. This one, for Linux, is the
|
||||
// `main` in io.h: define JSRT_NO_HOST to bring another
|
||||
//
|
||||
// jsrt_start() runs the program's top level, then its microtasks
|
||||
// jsrt_complete(h) op `h` is done: runs its callback, then the microtasks.
|
||||
// The op's result can be read only until this returns
|
||||
#pragma once
|
||||
|
||||
// io.h needs Linux's syscall() and mmap(), which -std=c11 hides. This must
|
||||
@@ -20,6 +28,12 @@
|
||||
#endif
|
||||
|
||||
#include "core.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void jsrt_start(void);
|
||||
void jsrt_complete(int32_t h);
|
||||
|
||||
#include "str.h"
|
||||
#include "number.h"
|
||||
#include "any.h"
|
||||
|
||||
Reference in New Issue
Block a user