JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

ev/spawn

core-api


    macro
    boot.janet on line 3903, column 3

    (ev/spawn & body)

    Run some code in a new task fiber. This is shorthand for `(ev/go 
    (fn [] ;body))`.
See also:ev/call1 exampleSign in to add an example
Loading...
(ev/spawn (os/sleep 1) (print "Hard work is done!"))

# prints "Hard work is done!" after one second
# this is the easiest way to put some forms on the event loop
# but do not forget REPL is blocking, for now, so run the example with `janet -e`
pepePlayground