JanetDocsPlaygroundI'm feeling luckyGitHub sign in

ev/go



    cfunction
    src/core/ev.c on line 2736, 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 wrappedwith `fiber/new` first. Optionally pass a value 
    to resume with, otherwise resumes with nil. Returns the fiber. 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