Powerful Google developer tools for immediate impact! (2023-24 C)
Liftweb and netty for web development.key
1. In the Brain of Franz Bettag
Director of R&D and Network Operations at
SkillsMatter, London, 2012
Liftweb and Netty for Web Development
2. Franz Bettag
27 years old
Nuremberg, Germany
Liftweb Committer
Director of R&D and Network Operations at wasted.io Ltd.
Who am I?
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. 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. 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?
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
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. ctx.channel (or .getChannel on Netty3)
ctx.attr(OurNettyAttrs.connected).set(new Date)
OurSingleton.ourAkkaActor ! ctx.channel
that’s it!
Netty with Akka
28. @fbettag on Twitter
code at http://github.com/fbettag
blogging at http://uberblo.gs
Get home safely
Thanks for listening!
Notes de l'éditeur
\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 &#x201C;main&#x201D;.\n\nA class attribute with the prefix &#x201C;lift:&#x201D; 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&#x2019;s allright, you don&#x2019;t have to believe me, i&#x2019;ll show you.\n
Now to one of the downsides of Liftweb, the Menu\n
Ugly problems\n
Even when it&#x2019;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&#x2019;s the easiest it gets compared to Liftweb\n\ni know, it&#x2019;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&#x2019;s allright, you don&#x2019;t have to believe me, i&#x2019;ll show you.\n