akka & pekko
-
Messages and Behaviorakka & pekko/actors 2023. 7. 17. 13:23
ref ! s"Forwards: $message" 1. messages can be of any type messages must be IMMUTABLE messages must be SERIALIZABLE (in practice use case class and case objects import akka.actor.{Actor, ActorSystem, Props} object TestActor { def main(args: Array[String]): Unit = { val actorSystem: ActorSystem = ActorSystem(name = "actorCapabilitiesDemo") class SimpleActor extends Actor { override def receive: R..
-
Actor 생성akka & pekko/actors 2023. 7. 17. 11:15
import akka.actor.{Actor, ActorRef, ActorSystem, Props} object AkkaMain { def main(args: Array[String]): Unit = { // name 으로는 alphabet 만 사용 가능 ('-, _, space' 도 사용 불가) val actorSystem: ActorSystem = ActorSystem(name = "firstActorSystem") println(actorSystem.name) class Person(name: String) extends Actor { // type Receive = PartialFunction[Any, Unit] override def receive: Receive = { case "hi" => ..
-
akka actors 소개akka & pekko/actors 2023. 7. 17. 11:05
https://www.udemy.com/course/akka-essentials/ 의 강의 내용을 정리한다. akka license 변경이 있지만 apache pekko 를 기대해 보도록 한다. libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % "2.6.18" libraryDependencies += "com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.18"