ClojureDocs

导航

命名空间

轮询!

  • (poll! 端口)
Takes a val from port if it's possible to do so immediately.
 Never blocks. Returns value if successful, nil otherwise.
1 Example
(let [c (chan)]
  (println (poll! c)))

;; nil
;;=> nil (it does not block even though there is no buffer!)

(let [c (chan 1)]
  (println (offer! c 10))
  (println (poll! c)))
;; true
;; 10
;;=> nil
See Also

Puts a val into port if it's possible to do so immediately. nil values are not allowed. Never blo...

Added by eduardobull
0 Notes
No notes for poll!