4 ms·
Akka is what you’re looking for: https://akka.io/ https://akka.io/ It is very deliberately inspired by Erlang and used widely in JVM applications.
by rrwright 7y ago
Akka is what you’re looking for: https://akka.io/ https://akka.io/
It is very deliberately inspired by Erlang and used widely in JVM applications.
- pjmlp 7y agoWith Akka.NET as the .NET counterpart.
- smabie 7y agoWhile 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.
- kitd 7y agoThanks, I've used Akka. I was thinking more about the messaging style than the "actors-on-JVM" thing.