File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,20 @@ object EventLoop {
99 // Schedule loop execution after main ends
1010 scalanative.runtime.ExecutionContext .global.execute(
1111 new Runnable {
12+ /**
13+ * This is the implementation of the event loop
14+ * that integrates with libuv. The logic is the
15+ * following:
16+ * - First we run all Scala futures in the default
17+ * execution context
18+ * - Then in loop:
19+ * - we check if they generated IO calls on
20+ * the event loop
21+ * - If it's the case we run libuv's event loop
22+ * using UV_RUN_ONCE that blocks only once
23+ * - We run the default execution context again
24+ * in case the callbacks generated new Futures
25+ */
1226 def run (): Unit = {
1327 scala.scalanative.runtime.loop()
1428 while (uv_loop_alive(loop) != 0 ) {
You can’t perform that action at this time.
0 commit comments