Your SlideShare is downloading. ×
Using Websockets in Play !
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Using Websockets in Play !

1,663
views

Published on

Using Websockets in Play !

Using Websockets in Play !


1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total Views
1,663
On Slideshare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
7
Comments
1
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Knoldus Software LLP Using WebSockets In Play! Neelkanth Sachdeva Software Consultant neelkanthsachdeva.wordpress.com
  • 2. Agenda Short Polling Long Polling WebSockets Websockets with Play ! The Play Chat Application Using Wesockets
  • 3. Short Polling Drawbacks : Resource Intensive Slow Even Very Slow One Request / One Response
  • 4. Long Polling Drawbacks : - Half Duplax - Again one request / one response
  • 5. Whats our probelm Lots of incoming messages
  • 6. Websockets
  • 7. WebSocket Features & Limitations Features : Full duplax communication Real time messages Efficient & Fast Drawbacks : Available with newer browsers
  • 8. Using Websockets with Play ! Producer Consumer
  • 9. Using Websockets with Play ! Producer Enumerator Consumer Iteratee
  • 10. Iteratees The Consumer Consumes chunks from Producer
  • 11. Enumerator The Producer - Produces typed chunks - Only produces if consumer is there.
  • 12. At Server : Creating a websocket connection needs a Producer (Enumerator) & a Consumer (Iteratee)
  • 13. At Client : Creating a socket connection. var socket = new WebSocket(“ws://localhost:9000”) The Events - onmessage - onopen - onclose
  • 14. Understand it through play sample chat application available here : https://github.com/playframework/playframework/tree/master/samples/scala/websocket-chat
  • 15. Cheers !