In the Brain of Franz Bettag      Director of R&D and Network Operations at             SkillsMatter, London, 2012Liftweb ...
Franz Bettag27 years oldNuremberg, GermanyLiftweb CommitterDirector of R&D and Network Operations at wasted.io Ltd.       ...
Code Scala projects for Customers (Liftweb and Netty)Network Administration (UNIX/BSD, BGP/OSPF Routing, ...)Research new ...
BSD over everything (i mean it)JVM over Erlang for concurrency (the syntax, yikes!)PostgreSQL, Cassandra and Redis fan (aw...
15 years of coding (9 years commercial)14 years on FreeBSD and NetBSD (i acquired my taste early)7 years on PostgreSQL (my...
Liftweb                Templates                Comet                MenuLiftweb Framework
Netty                 Long-Polling                 WebSockets                 paired with AkkaNetty IO Framework
Aren’t they just easy to read?Liftweb Templates
Liftweb Templates
Drop dead easy!Liftweb Comet
Liftweb Comet
Liftweb Comet
Liftweb Comet
You don’t believe me? Allright, i’ll show you then!
One of my worst nightmares!   Liftweb Menu
Liftweb Menu
I’m singing in the rain!Netty Long-Polling
Fast (1k connects per core per second without issues)Efficient (10k concurrent connections easily)Fun (extending ChannelGro...
Netty Long-Polling
Uh ah, it’s that easy?Netty WebSockets
Netty WebSockets
Netty WebSockets
Not the other way around!Netty with Akka
Channels provide   The current state (open, closed, ...)   Configuration parameters (e.g. receive-buffer-size)   ChannelPip...
ctx.channel (or .getChannel on Netty3)ctx.attr(OurNettyAttrs.connected).set(new Date)OurSingleton.ourAkkaActor ! ctx.chann...
Sounds too good to be        true?   Fine, i’ll code again!
Follow us: @wastedio on Twitter! Are you wasting IO?
@fbettag on Twittercode at http://github.com/fbettag  blogging at http://uberblo.gs        Get home safelyThanks for liste...
Upcoming SlideShare
Loading in …5
×

Liftweb and netty for web development.key

2,554 views

Published on

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

No Downloads
Views
Total views
2,554
On SlideShare
0
From Embeds
0
Number of Embeds
28
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • Since i am, what they call a “devop”, my skills reach far beyond coding, but we’ll get to that on the next slide.\n
  • CFEngine, Anycast routing\n\n
  • BSD since i was 13\n\nI really like the reliable stuff\n
  • \n
  • \n
  • \n
  • \n
  • The class attribute tells Lift that the actual template starts with the element with the id “main”.\n\nA class attribute with the prefix “lift:” invokes a snippet that surrounds this<div> with the default chrome for the site and inserts the <div> at the "content" marker in the template.\n\nInvoke the ShowCode snippet which shows the source for the designated page and generates a link to the GitHub repository for this project.\n\n\n
  • \n
  • lift has the listener/manager pattern as traits for comet builtin\n
  • \n
  • updateListeners will update all listeners with the content of createUpdate() -> msgs vector\n
  • That’s allright, you don’t have to believe me, i’ll show you.\n
  • Now to one of the downsides of Liftweb, the Menu\n
  • Ugly problems\n
  • Even when it’s under heavy load, netty keeps it cool!\n
  • Ugly problems if you use Linux (epoll bug), but everybody who uses Linux might have bigger issues than that anyways, so *smirk*\n
  • explain options\nexplain \nat the end: AkkaServerHandler\n
  • \n
  • And that’s the easiest it gets compared to Liftweb\n\ni know, it’s java, just imagine less braces and semicolons ;)\n
  • this is the hard approach, if you really want to unify HTTP and WebSockets, then you need to handshake yourself.\n\nfirst, you dispatch the request in the messageReceived, then in the handleHttpRequest method you handshake if needed. (it will reconnect as websocket)\n\n
  • Since Netty is part of Akka, it made sense to me to try to combine them vice versa.\n
  • Netty3 only allows one user-defined Attr, case-class.\nNetty4 is dynamic, Perfect if you want to store information on them and stack them on a Vector\n
  • since channels are thread-safe\n
  • That’s allright, you don’t have to believe me, i’ll show you.\n
  • \n
  • \n
  • Liftweb and netty for web development.key

    1. 1. In the Brain of Franz Bettag Director of R&D and Network Operations at SkillsMatter, London, 2012Liftweb and Netty for Web Development
    2. 2. Franz Bettag27 years oldNuremberg, GermanyLiftweb CommitterDirector of R&D and Network Operations at wasted.io Ltd. Who am I?
    3. 3. Code Scala projects for Customers (Liftweb and Netty)Network Administration (UNIX/BSD, BGP/OSPF Routing, ...)Research new products for wasted.io Ltd. based on Scala What I do?
    4. 4. BSD over everything (i mean it)JVM over Erlang for concurrency (the syntax, yikes!)PostgreSQL, Cassandra and Redis fan (awesome stuff)PHP and MySQL will die! (I am the Exterminator) My bias?
    5. 5. 15 years of coding (9 years commercial)14 years on FreeBSD and NetBSD (i acquired my taste early)7 years on PostgreSQL (my taste got even better)4 years on Scala, Liftweb and Akka (excellent!)1 year on Netty (now it’s on!) My experience?
    6. 6. Liftweb Templates Comet MenuLiftweb Framework
    7. 7. Netty Long-Polling WebSockets paired with AkkaNetty IO Framework
    8. 8. Aren’t they just easy to read?Liftweb Templates
    9. 9. Liftweb Templates
    10. 10. Drop dead easy!Liftweb Comet
    11. 11. Liftweb Comet
    12. 12. Liftweb Comet
    13. 13. Liftweb Comet
    14. 14. You don’t believe me? Allright, i’ll show you then!
    15. 15. One of my worst nightmares! Liftweb Menu
    16. 16. Liftweb Menu
    17. 17. I’m singing in the rain!Netty Long-Polling
    18. 18. Fast (1k connects per core per second without issues)Efficient (10k concurrent connections easily)Fun (extending ChannelGroups made our heads spin) Netty Long-Polling
    19. 19. Netty Long-Polling
    20. 20. Uh ah, it’s that easy?Netty WebSockets
    21. 21. Netty WebSockets
    22. 22. Netty WebSockets
    23. 23. Not the other way around!Netty with Akka
    24. 24. Channels provide The current state (open, closed, ...) Configuration parameters (e.g. receive-buffer-size) ChannelPipeline of that particular Channel I/O operations (read, write, connect and bind) User-defined Attributes (Netty4 is extra nice!) Netty with Akka
    25. 25. ctx.channel (or .getChannel on Netty3)ctx.attr(OurNettyAttrs.connected).set(new Date)OurSingleton.ourAkkaActor ! ctx.channelthat’s it! Netty with Akka
    26. 26. Sounds too good to be true? Fine, i’ll code again!
    27. 27. Follow us: @wastedio on Twitter! Are you wasting IO?
    28. 28. @fbettag on Twittercode at http://github.com/fbettag blogging at http://uberblo.gs Get home safelyThanks for listening!

    ×