JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

ev/go

core-api


    cfunction
    src/core/ev.c on line 3009, column 1

    (ev/go fiber-or-fun &opt value supervisor)

    Put a fiber on the event loop to be resumed later. If a function is 
    used, it is wrapped with `fiber/new` first. Returns a task fiber. 
    Optionally pass a value to resume with, otherwise resumes with nil. 
    An optional `core/channel` can be provided as a supervisor. When 
    various events occur in the newly scheduled fiber, an event will be 
    pushed to the supervisor. If not provided, the new fiber will 
    inherit the current supervisor.


1 exampleSign in to add an example
Loading...
(def f (ev/go (coro "world"))) # coro is great for fast fiber creating
(ev/sleep 0.0001) # give ev a chance in the REPL, remove in file
(fiber/last-value f) # "world"
pepePlayground