Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Play Framework essentials

You're reading from  Play Framework essentials

Product type Book
Published in Sep 2014
Publisher
ISBN-13 9781783982400
Pages 200 pages
Edition 1st Edition
Languages
Author (1):
Julien R Foy Julien R Foy
Author Profile Icon Julien R Foy
Julien R Foy
Toc

Table of Contents (14) Chapters Close

Play Framework Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Building a Web Service 2. Persisting Data and Testing 3. Turning a Web Service into a Web Application 4. Integrating with Client-side Technologies 5. Reactively Handling Long-running Requests 6. Leveraging the Play Stack – Security, Internationalization, Cache, and the HTTP Client 7. Scaling Your Codebase and Deploying Your Application Index

Manipulating data streams by combining iteratees, enumerators, and enumeratees


Well, that's enough concepts for now. Let's put this in practice by implementing a new feature in our shop application: an auction room.

The idea is to allow multiple users to bid for an item of the shop in a room where all connected users instantly see the bids of others, as depicted in the following screenshot:

An auction room for the item Play Framework Essentials. The prices offered by Alice and Bob are followed by the form at the bottom where users can make new offers

Unidirectional streaming with server-sent events

In order to instantly send a notification to all the users of an auction room when one makes a bid, we have to provide an HTTP endpoint streaming these events. We can achieve this using server-sent events. Thus, we have at least two endpoints: one to make a bid and one to get the stream of bid notifications. We actually need a third endpoint to get the HTML page showing an auction room (illustrated...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime