circlet
circlet copied to clipboard
Using os module functions causes root fiber to panic
Hi, I'm trying to write a little web app on circlet and I'm trying to spawn some processes like this one when I receive a request to certain endpoint.
(defn getls
"gets ls from bin dir" []
(def procc (os/spawn ["ls"] :p {:in :pipe :out :pipe :err :pipe}))
(pp :waiting_for_proc)
(pp (:wait procc))
[(:read (procc :out) :all)
(:read (procc :err) :all)])
the first time I get the request nothing happens, but when I try to request again I got an error that says:
current fiber is already waiting for event
could you explain me why this happens? is this a bug or maybe I'm not familiar enough with how things work in Janet or with Circlet