November 2011
1 post
4 tags
Serializable dynamic Proxies
So, I found myself in a situation where I was creating JDK Proxies, and I was in control of the invocation of newProxyInstance and needed to make the Proxies transparently Serializable. The problem is that for it to work you need writeReplace, so that you’re in control of the rematerialization of the Proxy on the deserializing side using readResolve. However, the problem is that you need...
Nov 23rd
36 notes
June 2011
1 post
3 tags
DIY: Exhaustiveness checking on Scala Enums
Long time no blog, I’m not much of a writer, so here’s the code! Hardlink Cheers, √
Jun 30th
22 notes
March 2011
1 post
4 tags
Implementing PostStart in #Akka
This question comes up every now and then, and my answer has since the first time, been refined, so I thought I’d give the answer here. “How do I run some initialization logic in the thread of the dispatcher and not the creator of the actor?” I present to you, PostStart: If you can’t see the code, click here Easy? Enjoy!
Mar 5th
4 notes
February 2011
1 post
3 tags
This is exactly what I want Akka to solve
“The fact is that everyone has scalability issues, no one can deal with their service going from zero to a few million users without revisiting almost every aspect of their design and architecture.” Quoted from : http://37signals.com/svn/archives2/dont_scale_99999_uptime_is_for_walmart.php
Feb 25th
3 notes
December 2010
3 posts
5 tags
All #Actors in #Scala - compared
As a late Christmas present I bring this to you dear readers: I recently invited David Pollak (of Lift fame), Jason Zaugg (of Scalaz fame), Philipp Haller (of Scala Actors fame) and myself to collaborate on a feature matrix that would allow people to see the similarities and differences between the Actor libraries on the Scala platform. So I’d like to start out by thanking David, Jason,...
Dec 28th
12 notes
6 tags
√iktor needs your help!
I’ve got some ideas for conference/group talks that I have yet to assemble, but I thought I’d let the community have a vote in what they’d think be interesting. Proposal 1: Git things done Approx time: 45 minutes “This is a case-study on moving from CVS/SVN to Git I did at a previous employer. It’s about the challenges faced - cultural problems, technical...
Dec 27th
5 tags
Hardcore Pom
A fairly nice technique to speed up update- times in SBT is by using ModuleConfigurations. A ModuleConfiguration can be viewed as a filter on top of a repository, saying: “Only look in the repository if the artifact you’re looking for has the following group id.” Pattern: class MyProject(info: ProjectInfo) extends DefaultProject(info) { object Repositories {   //Add...
Dec 8th
November 2010
6 posts
4 tags
SBT-fu: Publish privately
Have you’ve ever had the problem that you need to publish some Jars where your colleagues need to find them, but they are your secret web-scale sauce Jars and no one on the outside should be able to see them? And you don’t get any permission to put the jars on a network share, and you’re not worthy of your own build server, says mr Infrastructure Manager? And you happen to be...
Nov 30th
4 notes
4 tags
Dispatchers in Akka 1.0-RC1
Curious about what we’ve done? A lot of work has gone into the different dispatchers through Akkas relatively short but intense life so far. Here are some news for Akka 1.0-RC1: 1) There is no public start/stop lifecycle anymore, the dispatcher will be started when it gets its first actor and will be stopped when the last actor leaves 2) The dispatchers will re-start when they get...
Nov 29th
1 note
4 tags
The Future is dead?
No! Long live the Future! Something that’s new in Akka 1.0-RC1 is the possibility to add hooks that are executed when a Future is completed. Behold! Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_22). Type in expressions to have them evaluated. Type :help for more information. scala> import akka.actor._ import akka.actor._ scala> import...
Nov 29th
2 notes
7 tags
Dependency Hell
I’ve been meaning to write something very thoughtful about dependency management over the past year, but haven’t found time to do it. So now I’ll just blurt it out and see what you think of it. Dependency management in Java land usually means keeping track of .jar-files - this is stupid. “What?” you say? Well packaging a .jar file means that you feel you’re...
Nov 28th
3 tags
When you don't handle it
Something that’s new in Akka 1.0-RC1 is the “unhandled”-callback for Actor. This is what it looks like:   /**     * User overridable callback.     *     * Is called when a message isn’t handled by the current behavior of the actor     * by default it throws an UnhandledMessageException     */     def unhandled(msg: Any){       throw new...
Nov 28th
3 tags
The self matters
What’s new in Akka 1.0-RC1 is that HotSwap now takes the following signature: case class HotSwap(code: ActorRef => Actor.Receive, discardOld: Boolean = true) Before it only had: case class HotSwap(code: Actor.Receive) So what’s new is that you can use the “discardOld” parameter to control if you want behaviors to be stacked or not. “discardOld = true”...
Nov 27th
1 note
October 2010
2 posts
7 tags
Akka 1.0-M1 is out!!
Hey! We, the Akka committers, are very proud to announce the release of Akka 1.0-M1, the first of 2 milestone releases leading up to the final 1.0 release. It is all thanks to a fantastic team [http://doc.akkasource.org/team] and user community. Thank you all for your time, hard work and great contributions. The full release notes can be seen here: [http://doc.akkasource.org/release-notes]....
Oct 21st
3 notes
4 tags
Cheaper ThreadBasedDispatchers in Akka 1.0
One of the small gems that will be available in Akka 1.0 is that ThreadBasedDispatcher is based upon ExecutorBasedEventDrivenDispatcher with a core thread pool of 1 and a max thread pool of 1 that allows core thread timeouts. This means that Actors with ThreadBasedDispatcher won’t hang on to any threads if they do not have anything to do.
Oct 11th
2 notes
August 2010
2 posts
Dispatcher configuration for Akka 0.10
Something that’s new for Akka 0.10 is the possibility to tweak the default dispatcher and the comet dispatcher in the akka.conf, this means that the operations guys can tweak the CPU usage and allows for greater possibilities to tune without recompiling. So I thought I ought to give an explanation of the different settings possible, but first, here is what it looks like in the akka.conf ...
Aug 19th
3 notes
4 tags
Dining hakkers
Ladies and gentlemen, I got inspired reading Actors all the way down so without more BS, I present to you: Dining Hakkers implemented in Akka using the ActorModel Can’t see the code?
Aug 17th
7 notes
July 2010
1 post
4 tags
A new era
So last friday was my last day at Yves Rocher Nordique, and it has been some very rewarding, interesting and inspiring years there. I’d like to thank my team: Jack, John, Oscar, Magnus, Kristoffer and Manne - keep being ninjas and do what’s right. We’ve managed to pull things off no one could ever dream of, so it feels great to leave when things are going great. But as always,...
Jul 18th
3 notes
May 2010
3 posts
Akka Message Routing: Part 2
This is the second part of the akka message routing miniseries. This time I’m going to show you how to create a message loadbalancer, so without further ado: Can’t see the code? That wasn’t hard was it? Now, go experiment and perhaps create your own message distribution algorithms, there’s already one that dispatches depending on target mailbox size, effectively...
May 8th
4 notes
3 tags
Akka Message Routing: Part 1
This is the start of a miniseries of the components available to do interesting message dispatching. Here’s a common scenario: Depending on the message, I want to forward it to different other Actors. Enough talk, here’s some code! Can’t see the code? That was simple enough, right? Stay tuned for the next part!
May 3rd
3 notes
3 tags
To reply, or to reply_?
When you’re writing an Akka Actor and want to reply to a message, there are a number of options, two of them are reply(msg) and reply_?(msg), and today I’ll tell you when to use which. Can’t see the code? So the lesson of today: use reply(msg) then you require that there’s someone listening to the reply message, and reply_?(msg) if it’s ok to discard the reply...
May 2nd
3 notes
April 2010
1 post
7 tags
First
So here I am, all sweaty and tired from moving all the way from Blogger. I got really sick and tired of that place, and I even decided to bury my old blog posts there. To start over with a clean slate. This will be the place to look for news on good stuff like Scala, Akka and other promising new tech.
Apr 25th
4 notes