Scala/Scala.js library for simple, unified communication between Scala systems. The idea is to have a single interface at the core of the library, Transport, which allows to write generic network applications. Depending on the platform, one can then use any of the available implementations of this interface:
Platform | WebSocket | SockJS | WebRTC |
---|---|---|---|
JavaScript | client | client | client |
Play Framework | server | server | - |
Netty | both | incomming | - |
Tyrus | client | - | - |
In addition, the library provides wrappers for Autowire and Akka/scala-js-actors on top of the Transport interface for higher level of abstraction. More information can be found on this report, chapter 2 is about the library.
To avoid unnecessary dependencies, the library it split on 8 artifacts, pick only what you need if you don't want to download Play, Akka and Netty. It's on Sonatype Snapshots, compiled for Scala 2.11 and Scala.js 0.6.0+:
resolvers +=
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
libraryDependencies ++= Seq(
"com.github.olivierblanvillain" %%% "transport-core" % "0.1-SNAPSHOT",
"com.github.olivierblanvillain" %%% "transport-javascript" % "0.1-SNAPSHOT",
"com.github.olivierblanvillain" %%% "transport-webrtc" % "0.1-SNAPSHOT",
"com.github.olivierblanvillain" %%% "transport-netty" % "0.1-SNAPSHOT",
"com.github.olivierblanvillain" %%% "transport-play" % "0.1-SNAPSHOT",
"com.github.olivierblanvillain" %%% "transport-tyrus" % "0.1-SNAPSHOT",
"com.github.olivierblanvillain" %%% "transport-rpc" % "0.1-SNAPSHOT",
"com.github.olivierblanvillain" %%% "transport-akka" % "0.1-SNAPSHOT"
)
- Core:
- transport.Transport (js+jvm)
- transport.ConnectionUtils (js+jvm)
- JavaScript:
- WebRTC:
- Netty:
- Play:
- Tyrus:
- RPC:
- transport.rpc.RpcWrapper (js+jvm)
- Akka:
- transport.akka.ActorWrapper (js+jvm)
To use the ActorWrapper on JavaScript you will to publish-local
scala-js-pickling and scala-js-actors for Scala.js 0.6.0.