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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user