Your SlideShare is downloading. ×
Iteratee and stream with Play2 scala
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

Iteratee and stream with Play2 scala

1,686

Published on

slides of my talk for tokyo scala user group

slides of my talk for tokyo scala user group

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,686
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
23
Comments
0
Likes
5
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. MANAGE STREAMS WITH ITERATEE AND PLAY FRAMEWORK BY @WAXZCE TOKYO SCALA USER GROUP
  • 2. WHO AM I ? CEO of Clever Cloud PaaS provider @waxzce on twitter www.clever-cloud.com
  • 3. WHY WE NEED ITERATEE ? SO,
  • 4. ITERATEE HANDLING STREAMS, LET’S FIND EXAMPLE IN FACTS
  • 5. WHAT IS INSIDE AN HTTP REQUEST ? Verb • The action Resource • The object of the action Headers • The context of the action Body • Optional • The datas
  • 6. IN MANY CASE THE REQUEST IS MANIPULATE ALL FROM MEMORY
  • 7. File upload for example BUT SOMETIMES THE BODY PART IS FAT
  • 8. THERE IS 3 WAY TO RESOLVE THE PROBLEM
  • 9. PUT ALL IN MEMORY
  • 10. CREATE TEMP FILE Built in on play with
  • 11. ACTING DIRECTLY ON STREAM
  • 12. HTTP REQUEST IS STREAM
  • 13. SO WE WILL JUST MANAGE THE BODY STREAM JUST DO NOT REWRITE HTTP PARSER
  • 14. CLASSIC JAVA STREAM MANAGEMENT
  • 15. CLASSIC JAVA STREAM MANAGEMENT • Low performances if not buffered • Not modular • Thread blocking • Code is ugly
  • 16. SCALA WAY : ITERATEE
  • 17. Like a recipe Consume the data ITERATEE : HOW TO MANAGE A STREAM
  • 18. Produce the data ENUMERATOR : DATA STREAM
  • 19. Set of tools to do cool things with Iteratee and Enumerator ENUMERATEE
  • 20. SIMPLE ITERATEE EXAMPLE
  • 21. BODY PARSERS REQUEST HEADERS -> ITERATEE[ARRAY[BYTE], EITHER[RESULT, ?]]
  • 22. EXAMPLE MANAGING BODY
  • 23. GET FILE AND CALCULATE HASH FROM CHUNK
  • 24. NOW LIVE CODE !
  • 25. GIFT FROM CLEVER CLOUD Use tokyoscala as coupon code for free hosting  On clever-cloud.com

×