3 ms·
While Akka is great, it’s nowhere near as powerful as Erlang. Most notably, the inability to have a blocking actor yield control significantly changes the actor
by smabie 7y ago
While Akka is great, it’s nowhere near as powerful as Erlang. Most notably, the inability to have a blocking actor yield control significantly changes the actor model (for the worse). Instead of being able to use messages like async function calls, you have to keep a lot of internal state managing all the actors you still haven’t gotten messages back from. This creates a lot of messiness and greatly complicates things. For example you can’t write something like:
foobar = send(actorA, GetDbVal(foo)) + send(actorB, GetDbVal(bar))
Instead you would need to construct some sort of mutable dictionary that keeps track of when it got both messages and when it does, have the actor finally add the stuff together. It’s not always so bad, but when you have actors that are interacting with a lot of other actors and querying many different resources, it becomes a problem. Akka tries to mitigate this problem with the state change function become(), which allows you to build a FSM to handle state transitions. While this helps a lot, it’s not a panacea.
I think I read somewhere that true multi-tasking is in the works for the JVM, so this hopefully won’t always be a problem. As it stands, it’s probably the biggest limitation of the platform atm.