1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-11 13:03:08 +00:00

Move read/write functions into ev.c from net.c

This code can also be used for non-network streams.
This commit is contained in:
Calvin Rose
2020-11-14 11:48:23 -06:00
parent 761273bcc4
commit b3e88a8d80
5 changed files with 504 additions and 408 deletions

View File

@@ -2733,6 +2733,12 @@
(if (dyn sym)
form))
(guarddef ev/go
(defmacro ev/spawn
"Run some code in a new fiber. This is shorthand for (ev/call (fn [] ;body))."
[& body]
~(,ev/call (fn [] ,;body))))
(guarddef net/listen
(defn net/server
"Start a server asynchornously with net/listen and net/accept-loop. Returns the new server stream."