scala - What do Futures and Agents in Akka offer over Clojure's counterparts? -


having watched presentation composable futures akka 2.0, curious know additional features akka implementation of futures , agents bring on clojure's ones.

"agents in akka inspired agents in clojure." first line in agent documentation on akka , clears agents part of question. far futures concerned, both same conceptually (i.e invoking operation on separate thread). underlying implementation based on java.util.concurrent, both using same underlying infrastructure.

scala part: important part how composable word come play (both agents , futures). if go akka docs find can use higher-order functions map, filter etc. on akka futures, i.e. map operation on future returns future (and filter). allows compose/chain futures , wait on final future final value. now, possible because map, filter, for comprehension etc. based on scala (monadic) api allows new type provide specific implementations of these functions.

clojure part: on clojure side of things, know map, filter etc normal functions work on collections, i.e work on can traversed , hence different concept monadic api of scala. in clojure use different ways compose futures after clojure (or lisp in general) allow composability in many many ways


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -