New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bayeux-rack

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bayeux-rack

  • 0.6.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= bayeux.rack

Bayeux (COMET or long-polling) protocol server as a Sinatra application. Light weight and high scalability are achieved by using the asynchronous Rack extensions added to Thin by async_sinatra.

Because it uses async_sinatra, which uses EventMachine, it won't work in Passenger. Sorry about that, but Apache doesn't really like long-polling anyhow. Use Thin.

You can see a video presentation of this code here: http://www.youtube.com/watch?v=Bhj9QOfNd4c

== Usage

See http://github.com/cjheath/jquery.comet for an example of usage and for a COMET client in Javascript.

class MyServer < Bayeux configure do # The default :public is inside the Bayeux gem set :public, File.dirname(FILE) end

def deliver message
  case channel_name = message['channel']
  when '/my/interesting/channel'
data = message['data']
if data == 'ping'
  publish :channel => channel_name, :data => 'pong'
else
  super
end
  else
super
  end
end

end

== Installing

gem install bayeux-rack

== License

The MIT license.

== Developing

Fork on github https://github.com/cjheath/bayeux-rack or just clone to play:

git clone git://github.com/cjheath/bayeux-rack.git

Patches welcome! Fork and send a pull request. Please follow coding conventions already in use. Please use jslint if you can. There are currently no warnings, please keep it that way.

== Status

Current release has a happy path (working ok). Significant drawbacks to be fixed are:

  • Server-side timeout of long-polls to avoid possible loss of sent messages
  • Detecting multiple connections (tabs?) from the same browser, to fall back to callback polling.

FAQs

Package last updated on 03 Aug 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc