JanetDocsI'm feeling luckyGitHub sign in

thread/send



    cfunction

    (thread/send thread msgi &opt timeout)

    Send a message to the thread. By default, the timeout is 1 second,
    but an optional timeout in seconds can be provided. Use math/inf for
    no timeout. Will throw an error if there is a problem sending the
    message.


1 exampleSign in to add an example
Loading...
(defn worker [m]
  (thread/send m "Hello function")
  (:send m "Hello method"))

(thread/new worker)
(pp (thread/receive)) # => prints Hello function
(pp (thread/receive)) # => prints Hello method
pepe