core.async

Details

Type:
Enhancement

Status:
Resolved

Priority:
Trivial

Resolution:
Declined

Affects Version/s:
None

Fix Version/s:
None

Component/s:
None

Labels:

None

Description

There are cases where one may be handed a value which could possibly be a channel. It would be nice to have a function which returns true if a value is a channel. This can currently be done from user code but requires reaching into the clojure.core.async.impl.channels namespace and depending on an implementation detail.

We're rejecting this feature for now. If you need to check if an object implements the correct interfaces, feel free to dive into clojure.core.async.impl.protocols and check for satisfies? against ReadPort and WritePort. Not only do these allow you to accept ReadPorts that aren't channels, but it also keeps the main interface from getting cluttered.

At least this was the argument Rich proposed last time we talked. If this won't work, feel free to submit a new ticket or start a clojure-dev mailing list thread.

Timothy Baldridge
added a comment - 12/Dec/13 10:37 PM We're rejecting this feature for now. If you need to check if an object implements the correct interfaces, feel free to dive into clojure.core.async.impl.protocols and check for satisfies? against ReadPort and WritePort. Not only do these allow you to accept ReadPorts that aren't channels, but it also keeps the main interface from getting cluttered.
At least this was the argument Rich proposed last time we talked. If this won't work, feel free to submit a new ticket or start a clojure-dev mailing list thread.

Kaspars Dancis
added a comment - 24/Mar/15 3:42 PM Would it make sense to move or at least alias the protocols in clojure.core.async? .impl. seem to imply that it's not public interface and is subject to change.