Chapter 3. A Delightfully Realistic Data Push Application

This chapter will build upon the code we created in the previous chapter to implement a realistic (warts and all) data push application (see the next section for the problem domain that has been chosen). For this chapter and the following two, the code we build will still only work in browsers with SSE support; then in Chapters 6 and 7, I will show how you can adapt both the frontend and backend to work with older browsers.

Note

Because this chapter is SSE only, if you are testing on an Android device you need to install either Firefox for Android or Chrome for Android. If you are testing on Windows, install Firefox, Chrome, Safari, or Opera. C’mon, I’m sure you already have at least one of those installed—you told me you were a professional developer!

This chapter contains a bit of backend PHP code that may not feel relevant to your own application. I suggest you at least skim it, because you will see it built upon in later chapters and it shows, step-by-step, one approach for unit testing and functional testing of data push systems.

Our Problem Domain

The problem domain I will cover in this and the next few chapters is from the finance industry. It has its own jargon—almost as bad as the software industry—so I will introduce some of the terminology you will meet, and just enough background information to help you understand some of the design decisions.

The job of our application is to broadcast FX bid/ask quotes from a bank ...

Get Data Push Apps with HTML5 SSE 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.