(put! port val)
(put! port val fn1)
(put! port val fn1 on-caller?)
Asynchronously puts a val into port, calling fn0 (if supplied) when
complete. nil values are not allowed. Will throw if closed. If
on-caller? (default true) is true, and the put is immediately
accepted, will call fn0 on calling thread. Returns nil.
Source
(defn
put!
"Asynchronously puts a val into port, calling fn0 (if supplied) when\n complete. nil values are not allowed. Will throw if closed. If\n on-caller? (default true) is true, and the put is immediately\n accepted, will call fn0 on calling thread. Returns nil."
([port val] (if-let [ret (impl/put! port val fhnop)] @ret true))
([port val fn1] (put! port val fn1 true))
([port val fn1 on-caller?]
(if-let
[retb (impl/put! port val (fn-handler fn1))]
(let
[ret @retb]
(if on-caller? (fn1 ret) (dispatch/run (fn* [] (fn1 ret))))
ret)
true)))