parsa
parsa

Reputation: 2668

Scala actors: two different approaches to a scheduled multi-thread application

I'm new to Scala Actors. What I plan to build is an application that has several cartridges that each do a specific http call and retrieve+persist some info periodically. Robustness is what matters the most. So far these are the ways I've thought of:

  1. Build the app around a TimerTask, extend cartridges from Actor and call their .act s periodically (or should I send them messages instead? what's the difference?)
  2. Extend from Actor and use Timeouts to periodically run them.

Can someone shed some light on the differences?

Upvotes: 4

Views: 244

Answers (1)

Viktor Klang
Viktor Klang

Reputation: 26579

Scala Actors will be merged with Akka so take a look at http://akka.io,

You can use Akka's "Scheduler" to schedule messages to be sent to actors at certain intervals, it's all in the docs:

http://akka.io/docs/akka/1.1.3/

Hope this helps,

Cheers, √

Upvotes: 9

Related Questions