Akka as the concurrency model for Clojure
Asked Answered
O

3

6

Looks there is a lot of cool things about Akka framework (I don't really understand the framework, hope to dig into it soon).
Is it encouraged to use Akka in Clojure? does it make sense to use Akka as the concurrency model in Clojure projects and drop the built in facilities?

Oogenesis answered 25/3, 2011 at 1:19 Comment(0)
C
13

Clojure has lots of built in support for dealing with concurrency. There's no need to bring an actor libarary into your project unless you actually need actors. Your question doesn't detail the architecture or design of your system, so I can't really speak to whether or not actors are necessary for your project, but I certainly wouldn't jump right into it. Take a look at Clojure's agents and other concurrency primitives first. They should suit your needs quite nicely.

As far as Akka (or any actor library) as the concurrency model for Clojure, that is not the way the language was designed. You may choose to use an actor library for your application, but it is not the approach that the Clojure language has adopted.

Cartwell answered 25/3, 2011 at 2:3 Comment(6)
Clojure has no support for distribution, right? So if you want to scale to more than one machine, what do you do in Clojure?Delagarza
there is a "actors library for Clojure modelled after Erlang OTP plaform." (and erlang was an inspiration for akka??) github.com/antoniogarrote/jobim and antoniogarrote.wordpress.com/2010/09/03/…Yves
That's correct, there is no support for distribution. Most of the time people think they need distribution and end up in a tangled mess of actors when all they really needed was a queue or something simple. This is not the case for everyone, but it is the common case :)Cartwell
@Viktor - there are multiple ways of doing distribution in Clojure, they are just provided in libraries rather than the core language. Zach Tellman's Aleph framework is possibly the most interesting - github.com/ztellman/alephWolverine
But of course, not even Scala has built in distribution into the language.Delagarza
Right now Aleph looks like the winner within clojurescript, or does it? you'd still need to connect between Aleph and your local clojure actors to emulate what Akka does, but that would be a very very thin layer...Benedikt
T
4

It depends on if your project is already using the built-in facilities. It also depends on if your company/project tolerates the idea in the first place, tolerates the licensing terms of the library, and whether you/your group is willing to live with the community support or pay for the commercial support.

See:

Besides this, it will come down to preference for the developers of your project, maintainability of the code you'd write vs the standard facilities, level of support for the library, acceptance of the library within the Clojure software development community, etc.

My advice is to evaluate it and make comparative proof-of-concept prototypes with all the technologies you are considering.

This sort of advice is applicable when adding any third-party code to a project.

Accepting someone else's opinion blindly could cost you a lot of time, effort, money, and support from other developers.

Trifoliate answered 25/3, 2011 at 1:50 Comment(2)
Note that I don't know much of anything about Clojure, or this library, but I have evangelized and achieved acceptance of third-party libraries in multiple projects/companies. Hope this helps :)Trifoliate
This is one of the most professional and pragmatic advices ever.Oogenesis
O
1

Pulsar projects brings Lightweight threads, CSP and Erlang-like actors for Clojure.

Oogenesis answered 7/8, 2013 at 15:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.