From 30ea6fa8b44f62bfdc83c2bc42fb9bbc2fc7c030 Mon Sep 17 00:00:00 2001 From: Travis CI <> Date: Sat, 6 Feb 2021 15:58:10 +0000 Subject: [PATCH] Deploy to GitHub Pages: --- cli/modules/scheduler/scheduler.html | 23 ++++++++++++++++++--- cli/modules/timer/timer.html | 8 ++++--- modules/core/list.html | 31 +++++++++++++++++++++++++--- modules/core/map.html | 19 ++++++++++++++++- modules/core/num.html | 31 +++++++++++++++++++++++++++- modules/core/system.html | 3 +++ values.html | 1 + 7 files changed, 105 insertions(+), 11 deletions(-) diff --git a/cli/modules/scheduler/scheduler.html b/cli/modules/scheduler/scheduler.html index 8d6944e6..ed7dba9e 100644 --- a/cli/modules/scheduler/scheduler.html +++ b/cli/modules/scheduler/scheduler.html @@ -60,9 +60,26 @@

Scheduler Class

-

TODO

-

Methods #

-

TODO

+

The Scheduler class maintains a list of fibers, to be started one after the other, when a signal to do so is received. The signal (a private method call) is typically transmitted by long running methods in the File or Timer classes which suspend the current fiber so that Wren can carry out other tasks in the meantime.

+

Static Method #

+

Scheduler.add(callable) #

+

Adds a new fiber to the scheduler’s fibers list. This fiber calls callable and then transfers to the next fiber in the list, if there is one.

+

callable is a function or other object which has a call() method.

+
+var a = 3
+
+Scheduler.add {
+  a = a * a
+}
+
+Scheduler.add {
+  a = a + 1
+}
+
+System.print(a)        // still 3
+Timer.sleep(3000)      // wait 3 seconds
+System.print(a)        // now 3 * 3 + 1 = 10
+