1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-08 04:22:27 +00:00

Allow passing a function to directly to ev/go.

Makes ev/call less useful but ev/go more useful. No need
to construct as many identical intermediate fibers.
This commit is contained in:
Calvin Rose
2021-08-30 22:22:22 -05:00
parent bb1331e449
commit 5464a7a379
3 changed files with 39 additions and 7 deletions

View File

@@ -10,3 +10,13 @@
(ev/call worker :b 5)
(ev/sleep 0.3)
(ev/call worker :c 12)
(defn worker2
[name]
(repeat 10
(ev/sleep 0.2)
(print name " working")))
(ev/go worker2 :bob)
(ev/go worker2 :joe)
(ev/go worker2 :sally)