Skip to content

Instantly share code, notes, and snippets.

@harmeetsingh0013
Created July 1, 2017 10:09
Show Gist options
  • Save harmeetsingh0013/d69319feeebca4410a5bb1efc66ea7d6 to your computer and use it in GitHub Desktop.
Save harmeetsingh0013/d69319feeebca4410a5bb1efc66ea7d6 to your computer and use it in GitHub Desktop.
package com.harmeetsingh13.actors
import akka.actor.{Actor, ActorLogging, ActorSystem, Props}
/**
* Created by Harmeet Singh(Taara) on 1/7/17.
*/
class HelloWorldActor extends Actor with ActorLogging {
override def receive: Receive = {
case any =>
Thread.sleep(1000)
log.info(s"Hello $any")
}
}
object HelloWorldActor extends App {
val system = ActorSystem("HelloWorldSystem")
val ref1 = system.actorOf(Props[HelloWorldSelectionActor])
for (i <- 1 to 10000) ref1 ! "James"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment