1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-01 16:13:02 +00:00

Add ev api for making threaded calls.

Easy way to make arbitrary functions in C async.
This commit is contained in:
Calvin Rose
2020-12-31 16:12:42 -06:00
parent 788f91a36f
commit 0a1c93b869
7 changed files with 204 additions and 121 deletions

View File

@@ -1,6 +1,6 @@
(defn dowork [name n]
(print name " starting work...")
(os/execute ["sleep" (string n)] :p)
(os/execute [(dyn :executable) "-e" (string "(os/sleep " n ")")])
(print name " finished work!"))
# Will be done in parallel