mirror of
https://github.com/janet-lang/janet
synced 2025-11-07 11:03:04 +00:00
Add initial implementation for supervisor channels.
Supervisor channels are a simple concept to more efficiently enable dynamic, structure concurrency. When a top-level fiber completes (or errors), it will push itself to it's supervisor channel if it has one (instead of printing a stacktrace). This let's another fiber poll a channel and "supervise" a set of fibers.
This commit is contained in:
@@ -842,6 +842,7 @@ struct JanetFiber {
|
||||
#ifdef JANET_EV
|
||||
JanetListenerState *waiting;
|
||||
uint32_t sched_id; /* Increment everytime fiber is scheduled by event loop */
|
||||
void *supervisor_channel; /* Channel to push self to when signaling. */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user