background preloader

Performance

Facebook Twitter

The Redis Cookbook. Credit: Pieter Noordhuis Problem You want Redis to serve as the backend for an application that needs chat like communication (or arbitrary asynchronous communication) between its users.

The Redis Cookbook

Solution Use the Redis built-in commands PUBLISH and SUBSCRIBE. These commands use the concept of channels. When a client issues a SUBSCRIBE command, it cannot issue commands other than SUBSCRIBE and UNSUBSCRIBE until it is no longer subscribed to any channel. In the following example, connectionA and connectionB depict different connections for different users. connectionA> SUBSCRIBE room:chatty ["subscribe", "room:chatty", 1] connectionB> PUBLISH room:chatty "Hello there! " The SUBSCRIBE and UNSUBSCRIBE commands always return a three element array containing the action that was just performed, the channel that was concerned in the operation, and the number of remaining subscriptions after the operation.

Documentation. Pusher is a simple hosted API for quickly, easily and securely adding realtime bi-directional functionality via WebSockets to web and mobile apps, or any other Internet connected device.

Documentation

We offer a rich suite of libraries that you can use within your applications, including a JavaScript client library for web and HTML5 apps. Our event based abstraction makes it simple to bind UI interactions to events that are triggered from any client or server. Home Ralph Heinkel. WebSockets provide a way to communicate through a bi-directional channel on a single TCP connection.

Home Ralph Heinkel

This technology is especially interesting since it allows a web server to push data to a browser (client) without having the client to constantly poll for it. In contrast to normal HTTP requests where a new TCP connection gets opened and closed for each request web socket connections are kept open until one party closes them. This allows for communication in both directions, and calls can be made multiple times on the same connection.

In this little article I basically combine what I found on Sylvain Hellegouarch's documentation for ws4py (a WebSocket client and server library for Python) and the article HTML5 Web Socket in Essence by Wayne Ye. Push technology. General use[edit] Push services are often based on information preferences expressed in advance.

Push technology

This is called a publish/subscribe model. A client "subscribes" to various information "channels" provided by a server; whenever new content is available on one of those channels, the server pushes that information out to the client. Synchronous conferencing and instant messaging are typical examples of push services. Chat messages and sometimes files are pushed to the user as soon as they are received by the messaging service. Other uses of push-enabled web applications include market data distribution (stock tickers), online chat/messaging systems (webchat), auctions, online betting and gaming, sport results, monitoring consoles, and sensor network monitoring. W3C The WebSocket API Specification. Abstract This specification defines an API that enables Web pages to use the WebSocket protocol (defined by the IETF) for two-way communication with a remote host.

W3C The WebSocket API Specification

Status of This document This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at If you wish to make comments regarding this document in a manner that is tracked by the W3C, please submit them via using our public bug database.

You can also e-mail feedback to public-webapps@w3.org (subscribe, archives), or whatwg@whatwg.org (subscribe, archives). Notifications of changes to this specification are sent along with notifications of changes to related specifications using the following mechanisms: E-mail notifications of changes. Comet: Low Latency Data for the Browser. An old web technology is slowly being resurrected from the depths of history. Browser features that have gone untouched for years are once again being employed to bring better responsiveness to UIs. Servers are learning to cope with a new way of doing things. And I’m not talking about Ajax. New services like Jot Live and Meebo are built with a style of data transmission that is neither traditional nor Ajax.

Their brand of low-latency data transfer to the browser is unique, and it is becoming ever-more common. Defining Comet. The Definitive Guide to HTML5 WebSocket (9781430247401): Vanessa Wang, Frank Salim, Marcelo Jabali. Server-Sent Events. Abstract This specification defines an API for opening an HTTP connection for receiving push notifications from a server in the form of DOM events.

Server-Sent Events

The API is designed such that it can be extended to work with other push notification schemes such as Push SMS. Status of This document This section describes the status of this document at the time of its publication. Other documents may supersede this document. Server-sent events. Server-sent events (SSE) is a technology for where a browser gets automatic updates from a server via HTTP connection.

Server-sent events

The Server-Sent Events EventSource API is standardized as part of HTML5[1] by the W3C. History[edit] The WHATWG Web Applications 1.0 proposal[2] included a mechanism to push content to the client. On September 1, 2006, the Opera web browser implemented this new experimental technology in a feature called "Server-Sent Events". Overview[edit] Server-sent events is a standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. WebSocket Gateway. WebSocket. WebSocket is a protocol providing full-duplex communications channels over a single TCP connection.

WebSocket

The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011, and the WebSocket API in Web IDL is being standardized by the W3C. Technical overview[edit] W3C Web Workers Specification. Abstract This specification defines an API that allows Web application authors to spawn background workers running scripts in parallel to their main page.

W3C Web Workers Specification

This allows for thread-like operation with message-passing as the coordination mechanism. Status of This document This section describes the status of this document at the time of its publication. Web worker. A web worker, as defined by the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG), is a JavaScript script executed from an HTML page that runs in the background, independently of other user-interface scripts that may also have been executed from the same HTML page.[1] Web workers are able to utilize multi-core CPUs more effectively.

Web worker

[citation needed] The W3C and WHATWG envision web workers as long-running scripts that are not interrupted by user-interface scripts (scripts that respond to clicks or other user interactions). Keeping such workers from being interrupted by user activities should allow Web pages to remain responsive at the same time as they are running long tasks in the background. The simplest use of workers is for performing a computationally expensive task without interrupting the user interface. The W3C and the WHATWG are currently in the process of developing a definition for an API for web workers.[1] Overview[edit] <!