Fork me on GitHub

reading the docs (, what’s the difference between a port and a channel? what’s the difference between >! and onto-chan?

Alex Miller (Clojure team)13:01:08

A port is either the read or write end of a channel. A basic chan typically has a read port and a write port.

Alex Miller (Clojure team)13:01:53

onto-chan puts a collection of values onto a channel instead of just one


A lot of the core.async API uses the parameter name port where the parameter should be a channel


or at least, it used to (haven’t checked in a while)


thanks for the clarification @alexmiller. also I’d agree with @erik_price that when listing parameters it would be less confusing to say channel. e.g. (<! channel)

Alex Miller (Clojure team)23:01:27

It was unclear when we released async whether port and channel would diverge as concepts. They still might. It's particularly interesting to consider cases that need read or write ports but not both.