Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import akka.actor.{Actor, Props, ActorSystem}
- class ExampleActor extends Actor {
- def receive = {
- case i: Int =>
- println(i.toString)
- Thread.sleep(10000)
- case _ =>
- }
- }
- object ExampleActor {
- lazy val system = ActorSystem("exampleSystem")
- def newInstance = system.actorOf(Props(new ExampleActor))
- def test(): Unit = {
- 1 to 100 foreach { i =>
- newInstance ! i
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement