core.async

Add chan? or channel? function to identify a channel

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Trivial 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.

(defn channel? [c]
(satisfies? channels/MMC c))

Activity

Brenton Ashworth made changes -
Field Original Value New Value
Assignee Rich Hickey [ richhickey ]
Timothy Baldridge made changes -
Resolution Declined [ 2 ]
Assignee Timothy Baldridge [ halgari ]
Status Open [ 1 ] Resolved [ 5 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: