0.1.2 • Published 4 years ago

wsockmq v0.1.2

Weekly downloads
3
License
EPL-2.0
Repository
github
Last release
4 years ago
  • wsockmq

This is clojurescript library for http push, it's based on websocket transport and clojure.core/async and models message queue pub/sub api. Until [https://github.com/ring-clojure/ring/issues/393] is released, server websocket can be implemented with [https://github.com/sunng87/ring-jetty9-adapter], [https://github.com/ztellman/aleph], [https://github.com/jarohen/chord]

  • Usage

#+begin_src sh npm install wsockmq #+end_src

Caller is repsonsible for freeing connection

#+begin_src clojure (with-open socket (WebSocket.) (let url "wss://echo.websocket.org" (doto (->WSockMessageQueue socket url) (subscribe :hello (fn [{:keys payload}] (println payload))) (publish :hello "world") (unsubscribe :hello)))) #+end_src

  • License

Copyright © 2020, turbocafe. All rights reserved.

This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.