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

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: