我在试验核心异步混合。在混合中静音输入通道似乎是实现背压的可能方法之一。我使用的代码如下:
(def output-chan (chan))
(def input-chan (chan))
(def mixer (admix (mix output-chan) input-chan))
(toggle mixer {input-chan {:mute true}})计算REPL中的最后一行
CompilerException java.lang.IllegalArgumentException: No implementation of method: :toggle* of protocol: #'clojure.core.async/Mix found for class: java.lang.Boolean。
上面的示例代码有什么问题?
谢谢!
发布于 2016-04-12 02:09:48
(def搅拌机(混合(混合输出-陈)输入-陈))
您可以将admix的返回值赋给mixer,这是一个布尔值,而不是期望的混合器。尝试:
(def output-chan (chan))
(def input-chan (chan))
(def mixer (mix output-chan))
(admix mixer input-chan)
(toggle mixer {input-chan {:mute true}})https://stackoverflow.com/questions/36558355
复制相似问题