Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use akka in Scala 3?

How to use akka in Scala 3 ? I can't find akka dependencies while using scala 3

sbt errors :

[error]   not found: /Users/admin/.ivy2/localcom.typesafe.akka/akka-actor-typed_3/2.6.15/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/typesafe/akka/akka-actor-typed_3/2.6.15/akka-actor-typed_3-2.6.15.pom
[error] (ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.akka:akka-actor-typed_3:2.6.15
[error]   Not found
[error]   Not found
[error]   not found: /Users/admin/.ivy2/localcom.typesafe.akka/akka-actor-typed_3/2.6.15/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/typesafe/akka/akka-actor-typed_3/2.6.15/akka-actor-typed_3-2.6.15.pom
like image 313
Ji Shuai Avatar asked Jul 28 '21 13:07

Ji Shuai


People also ask

Is Akka compatible with Scala 3?

Akka has experimental support for Scala 3.

How does Scala Akka work?

Akka is written in Scala, with language bindings provided for both Scala and Java. Akka's approach to handling concurrency is based on the Actor Model. In an actor-based system, everything is an actor, in much the same way that everything is an object in object-oriented design.

Why Akka is used in Scala?

Akka is built with Scala, but offers both Scala and Java APIs to developers. At the heart of Akka is the concept of Actors, which provide an ideal model for thinking about highly concurrent and scalable systems. Writing concurrent systems using traditional low-level mechanism such as locks and threads is difficult.

Is Scala 3 production ready?

Scala 3 introduced a bunch of language features like enums, extension methods, new context abstractions, type lambdas and a lot of niceties that make our life easier. The compiler is also different, faster and with backward compatibility between Scala 3 versions. Is Scala 3 production ready? Yes!


Video Answer


1 Answers

akka-actor-typed is published for Scala 2.12, 2.13, not for Scala 3

https://mvnrepository.com/artifact/com.typesafe.akka/akka-actor-typed

Try compatibility mode

lazy val foo = project.in(file("foo"))
  .settings(
    scalaVersion := "3.0.0",
    libraryDependencies += 
      ("com.typesafe.akka" %% "akka-actor-typed" % "2.6.15")
        .cross(CrossVersion.for3Use2_13)
  )

https://docs.scala-lang.org/scala3/guides/migration/compatibility-classpath.html

like image 181
Dmytro Mitin Avatar answered Sep 24 '22 20:09

Dmytro Mitin