Hey all, what does this mean?
No implementation of method: :put! of protocol: #'clojure.core.async.impl.protocols/WritePort found for class: nil
looks like you've passed through a nil, when it expected a channel.
I’m passing it like this:
(>!! (:channel (:com.app.graphql.channel/channel state/system)) {:msg-type :update :data {:msg somevalue}})
where state/system is integrant.repl.state/system
I'd check that (:channel (:com.app.graphql.channel/channel state/system))
is returning what you think it is. My guess is that it is nil
Yeah, added the channel now but
No implementation of method: :put! of protocol: #'clojure.core.async.impl.protocols/WritePort found for class: clojure.lang.PersistentArrayMap
Install timbre
(>!!
(timbre/spy
(:channel (:com.app.graphql.channel/channel state/system)))
{:msg-type :update :data {:msg somevalue}})
Check what it prints
It’s probably a map now.
clojure.lang.ExceptionInfo: Invalid Timbre logging level: should be e/o #{:trace :debug :info :warn :error :fatal :report}
given: {:channel
#object[clojure.core.async.impl.channels.ManyToManyChannel 0x7ba8e11d "clojure.core.async.impl.channels.ManyToManyChannel@7ba8e11d"],
:publication
#object[clojure.core.async$pub$reify__13166 0x39b5607c "clojure.core.async$pub$reify__13166@39b5607c"]}
type: clojure.lang.PersistentArrayMap
So what does this mean now?
This is the channel initialisation:
(defmethod ig/init-key :com.app.graphql.channel/channel [_ _]
(let [channel (chan)]
{:channel channel :publication (pub channel :msg-type)}))
(>!! channel {:msg-type :update :data {:msg value}}) putting data inside it like this
Init somewhere in your project
(timbre/set-level! :trace)
This code is out of context. It’s not possible to see where/how you’re calling (>!! channel …).
@kishore.karnam do you have other core.async code working? These examples take a fair bit to pick through
it looks like you need to check your code again after setting up timbre correctly as per https://clojurians.slack.com/archives/C05423W6H/p1620649512148300?thread_ts=1620645717.146000&cid=C05423W6H
It should be (>!! (:channel channel) {:msg-type :update :data {:msg value}})) because :com.app.graphql.channel/channel is returning a map
🆒
glad you got it sorted. Happy coding