taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.73k stars 193 forks source link

Teething troubles #7

Closed keeds closed 10 years ago

keeds commented 10 years ago

Apologies, probably user error. I cannot get a simple setup working. I've been through the docs for setting up server and client side and cannot get a (chsk-send! ...) from the client working.

(ns bom.core
  (:require-macros
   [cljs.core.match.macros :refer (match)]
   [cljs.core.async.macros :as asyncm :refer (go go-loop)])
  (:require
   [cljs.core.match]
   [cljs.core.async :as async :refer (<! >! put! chan)]
   [taoensso.sente :as sente :refer (cb-success?)]
   ))

(let [{:keys [chsk ch-recv send-fn]}
      (sente/make-channel-socket! "/chsk"
        {} {:type :auto})]
  (def chsk       chsk)
  (def ch-chsk    ch-recv)
  (def chsk-send! send-fn))

(chsk-send!
  [:chsk/ping {:data "data"}]
  8000
  (fn [reply]
    (if (cb-success? reply)
      (.log js/console "Success")
      (.log js/console "Failure"))))

results in: image

ptaoussanis commented 10 years ago

Hi Andrew, about to head to sleep - will try take a look at this tomorrow and get back to you! Cheers :-)

ptaoussanis commented 10 years ago

Hey Andrew,

I've just pushed an update (still [com.taoensso/sente "0.8.0-SNAPSHOT"]) that fixes a few bugs and includes a working example project. Could you maybe check that out and let me know if you have better luck there?

ptaoussanis commented 10 years ago

Hi, any follow up on this? Did you have any luck with the newer version+example?

ptaoussanis commented 10 years ago

Closing for now, please feel free to reopen if you're still having any trouble :-)