mirror of
https://github.com/janet-lang/janet
synced 2025-08-01 16:52:52 +00:00
Merge pull request #1029 from locriacyber/patch-0
Fix documentation for ev/go, ev/spawn
This commit is contained in:
commit
bb8405a36e
@ -3568,7 +3568,7 @@
|
|||||||
(ev/go (fn _call [&] (f ;args))))
|
(ev/go (fn _call [&] (f ;args))))
|
||||||
|
|
||||||
(defmacro ev/spawn
|
(defmacro ev/spawn
|
||||||
"Run some code in a new fiber. This is shorthand for `(ev/call (fn [] ;body))`."
|
"Run some code in a new fiber. This is shorthand for `(ev/go (fn [] ;body))`."
|
||||||
[& body]
|
[& body]
|
||||||
~(,ev/go (fn _spawn [&] ,;body)))
|
~(,ev/go (fn _spawn [&] ,;body)))
|
||||||
|
|
||||||
|
@ -2687,9 +2687,10 @@ error:
|
|||||||
/* C functions */
|
/* C functions */
|
||||||
|
|
||||||
JANET_CORE_FN(cfun_ev_go,
|
JANET_CORE_FN(cfun_ev_go,
|
||||||
"(ev/go fiber &opt value supervisor)",
|
"(ev/go fiber-or-fun &opt value supervisor)",
|
||||||
"Put a fiber on the event loop to be resumed later. Optionally pass "
|
"Put a fiber on the event loop to be resumed later. If a function is used, it is wrapped"
|
||||||
"a value to resume with, otherwise resumes with nil. Returns the fiber. "
|
"with `fiber/new` first. "
|
||||||
|
"Optionally pass a value to resume with, otherwise resumes with nil. Returns the fiber. "
|
||||||
"An optional `core/channel` can be provided as a supervisor. When various "
|
"An optional `core/channel` can be provided as a supervisor. When various "
|
||||||
"events occur in the newly scheduled fiber, an event will be pushed to the supervisor. "
|
"events occur in the newly scheduled fiber, an event will be pushed to the supervisor. "
|
||||||
"If not provided, the new fiber will inherit the current supervisor.") {
|
"If not provided, the new fiber will inherit the current supervisor.") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user