…hope that other framework/library authors will do the same. The last thing I want to hear is " WebSocket keeps changing and most frameworks/libraries/services are broken". That will not increase the general adoption of WebSocket.
I also hope that this is technically interesting enough for people who want to know under the hood of WebSocket implementation, but not necessarily write a framework. (NOTE: If you are interested in just using WebSocket in various languages, then you …
…not that much different from the example above. This time the event is a particular message on a WebSocket connection, rather than a Sammy route. So the above example, adding a new story to the backlog looks like this when the trigger is a Pusher event: /public/javascripts/websockets.js
socket.bind('stories-create', function (attributes) { var story = new Story(attributes) Story.add(story) Backlog.plan() })
The two should look fairly similar because we expect the same …
…:: Controller provides a class called Cramp:: Controller:: Websocket . Cramp:: Controller:: Websocket is very similar to Cramp:: Controller::Action . If you don't know much about Cramp:: Controller::Action , you could read my introductory post on cramp.
As Cramp extends the underlying webserver to support websockets, you must tell it which webserver you are using : Cramp :: Controller :: Websocket .backend = :thin # or :rainbows
Cramp:: Controller:: Websocket…
…screen:
It seems we've ended writing almost more JS than Ruby :P Note that I've only tested this on Webkit nightly and latest Google Chrome beta for Mac.
Overall it was a great and easy experience building this simple system, but it allowed me to realize how simple we can build scalable push systems with the WebSocket API !
update : seems like Ilya Grigorik liked it :)
…displaying data from a Twitter feed or maybe you're sending and receiving data through a WebSocket (chat perhaps). In both cases you might not care about keeping the data beyond the page view but having the ability to work with models and collections is a convenience at the very least.
As a design constraint, to persist using REST means explicitly adding a REST adaptor at the time of class creation. var Project = Model("project", { persistence: Model.RestPersistence("/projects") …
Quite trivial, isn't it? It wraps the native WebSocket object you've come to know and love during the last 10 minutes. It then implements it's own event-binding and triggering mechanism and pipes said events from and to the server as JSON-encoded strings in the format we just defined.
In fact, you can even hook in multiple handlers to the same event, already an improvement over WebSocket semantics! server.bind('user_connected', function(user){ $('#messages').prepend( …
Other speakers will be myself ( WebSocket and node.js) and Luis Cipriani ( XMPP, BOSH and Strophe) who is going to be visiting New Bamboo from Brazil. We are also hoping to to do a bit of hacking session, so bring your laptop!!
It's our first attempt to provide our office for such an event and we are very excited to meet other people who are interested in node.js
For more detail and registration, please visit London JavaScript Meetup Group page.
…aka Ajax long polling), XMPP, FlashSocket, and WebSocket are currently available technology for Real Time Web. Each technology has pros and cons.
Many concurrency orientated languages/libraries/frameworks offer WebSocket solutions. Also some Comet based frameworks now offers WebSocket support as well.
WebSocket is NOT the silver bullet for all RTW scenarios.
The world of RTW and WebSockets is changing rapidly and new examples, blog posts, and libraries appear almost …