A leaven component for running sente asynchronous channel over websockets.
Add [com.palletops/bakery-sente "0.3.1-SNAPSHOT"]
to your
:dependencies
.
The com.palletops.bakery.sente/sente
function returns a
leaven component, in both clojure and clojurescript. It
takes a single map as argument with the following keys.
:path
: the path sente will use for ajax requests. Defaults to "/chsk".
:handler
: the handler function that will be called to handle each message.
:announce-fn
: a function that will be called with the channel socket as argument
when the channel is started.
:config
: a map passed to sente's make-channel-socket
function.
The component implements the Startable
and Stoppable
protocols in
an idempotent fashion. The component has a :routes
key that
contains ring routes for handling the ajax calls used by sente. These
routes need to be included in your applications http handler function.
The Startable
and Stoppable
implementations will start and stop
the client connection.
Copyright © 2014 Hugo Duncan
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.