Reputation: 1389
I am familiar with the Java producer and consumer model. I have a process that generates maps for another process to analyze. I have carried out earlier this model in java using producer & consumer model. I am trying the do the same in Scala. The tutorials talk about actors,messaging framework that does this process. But is there any good example that would explain them? and can the number of threads be controlled in Scala like in java?
Upvotes: 1
Views: 626
Reputation: 7732
Here's code that implements a producer/consumer model using Akka, the Scala framework for actors.
https://github.com/paulbutcher/AkkaProducerConsumerBenchmarks/tree/master/src
This is from the following web page:
http://paulbutcher.com/2013/01/22/benchmarking-producerconsumer-in-akka/
There's also akka-camel, with built-in Producer and Consumer classes:
http://doc.akka.io/docs/akka/snapshot/scala/camel.html
Upvotes: 3