Chapter 9. Publishing and Subscribing: A Shared Sketch Pad Introduction

WHAT'S IN THIS CHAPTER?

  • How publish-subscribe systems work

  • Using Data Forms

  • Creating and configuring pubsub nodes

  • Subscribing and unsubscribing from pubsub nodes

  • Publishing and receiving events

  • Using HTML5's <canvas> element

Chatting online is a great way for teams to communicate, but it is often ineffective at communicating visual ideas. In a face-to-face setting, the speaker can step up to a whiteboard and begin sketching out their ideas. In this chapter, you develop an application called SketchCast, which allows a presenter to broadcast a whiteboard session to a virtually unlimited number of participants. You develop SketchCast using one of XMPP's most powerful extensions, publish-subscribe, or pubsub as it is commonly called.

SketchCast is an example of a very simple vector drawing program. Similar programs can be found in almost every introductory book on graphics or GUI programming. SketchCast stretches this functionality to a shared environment, giving the entire audience a view of what the presenter is drawing.

A lot of functionality is required to bring this application to life beyond just the simple graphics. To enable others to see what someone is drawing, you must capture the drawing actions, transform them into a format suitable for transmission, send these actions across a network, and re-create them on the audience's computers. In addition, presenters will need some mechanism for setting up this whole ...

Get Professional XMPP Programming with JavaScript® and jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.