Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A wrapper that has the servlet for cometd2.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 functional-tests
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 project.clj
README.md

ring-cometd2-adapter

An ring adpater that includes the comet2d servlet.

Usage

Availabel on clojure jars. For use with lein.

 [net.matthoyt/ring-cometd2-adapter "0.1.1-SNAPSHOT"]

Publishing a message on a channel:

 (publish "channel/id" data)
 (publish "channel/id" data from-channel)

Defining services

 (defservices my-services
   ("service-name" "mychannel/*" handle))

Starting the server

 (run-jetty app
            {:port 8080 :servlets
             [(create-cometd-servlet)
              (create-bayeux-servlet my-services)]})

Adding a listener to see when a client session ends.

 (client-remove-listener client-session
                         (fn [session timeout]))

License

Jetty 7 adapter code: https://github.com/jalpedersen/ring-jetty7-adapter

Servlet Implementation: https://github.com/maxweber/hello-cometd

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.