我正在试验 core.async 的混音。似乎在混音中使输入通道静音将是实现背压的一种可能方式。我正在使用下面的代码:
(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
.
上面的示例代码有什么问题?
谢谢!