At the risk of sounding ultra noob, can anyone help me how do we send text data back via websockets when on-text handler is called for sure. I am on 0.8.1
> Whatever value is returned from the :on-open callback is retained, and passed as the second argument to the :on-close, :on-error, :on-text, and :on-binary callbacks. This can be a single value, such as a https://github.com/clojure/core.async/ channel, or a map, or whatever your application needs it to be.
in the on-open handler, you call start-ws-connection which should give you a channel, that you can then use to send data to the user in the other handlers
something along those lines:
{:on-open (fn [ws-channel req] (ws/start-ws-connection ws-channel nil))
:on-text (fn [ws-channel send-ch msg] (println "Received" msg) (a/>!! send-ch "My response"))
...}