Skip to content

Commit 0160b77

Browse files
authored
Adds http, management and spray modules. Extends actor module with pattern object (#4)
* add usage description * add http, management and spray modules * fix compilation
1 parent 08c0275 commit 0160b77

File tree

10 files changed

+136
-1
lines changed

10 files changed

+136
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
# akka-to-pekko-adapter
22
Enables the compiler to work with both Akka and Pekko classes
3+
4+
## Usage
5+
pick the desired module and add it as a dependency to your project. For instance to use actor module layer:
6+
```scala
7+
val version = ???
8+
libraryDependencies += "com.evolution" %% "akka-to-pekko-adapter-stream" % version
9+
```

build.sbt

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ lazy val root =
4444
publishArtifact := false
4545
)
4646
.settings(alias)
47-
.aggregate(actor, cluster, stream)
47+
.aggregate(
48+
actor,
49+
cluster,
50+
stream,
51+
spray,
52+
http,
53+
management,
54+
`cluster-sharding`
55+
)
4856

4957
lazy val actor =
5058
project
@@ -89,3 +97,39 @@ lazy val `cluster-sharding` =
8997
Dependencies.Pekko.sharding
9098
)
9199
)
100+
101+
lazy val spray =
102+
project
103+
.in(file("modules/spray"))
104+
.settings(commonSettings)
105+
.settings(
106+
name := "akka-to-pekko-adapter-spray",
107+
libraryDependencies ++= Seq(
108+
Dependencies.Pekko.spray
109+
)
110+
)
111+
112+
lazy val http =
113+
project
114+
.in(file("modules/http"))
115+
.dependsOn(actor, stream)
116+
.settings(commonSettings)
117+
.settings(
118+
name := "akka-to-pekko-adapter-http",
119+
libraryDependencies ++= Seq(
120+
Dependencies.Pekko.http
121+
)
122+
)
123+
124+
lazy val management =
125+
project
126+
.in(file("modules/management"))
127+
.settings(commonSettings)
128+
.settings(
129+
name := "akka-to-pekko-adapter-management",
130+
libraryDependencies ++= Seq(
131+
Dependencies.Pekko.management,
132+
Dependencies.Pekko.bootstrap,
133+
Dependencies.Pekko.`cluster-http`
134+
)
135+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package akka
2+
3+
object pattern
4+
extends org.apache.pekko.pattern.PipeToSupport
5+
with org.apache.pekko.pattern.AskSupport
6+
with org.apache.pekko.pattern.GracefulStopSupport
7+
with org.apache.pekko.pattern.FutureTimeoutSupport
8+
with org.apache.pekko.pattern.RetrySupport
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package akka.http
2+
3+
package object scaladsl {
4+
val Http: org.apache.pekko.http.scaladsl.Http.type =
5+
org.apache.pekko.http.scaladsl.Http
6+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package akka.http.scaladsl
2+
3+
package object model {
4+
5+
type HttpEntity = org.apache.pekko.http.scaladsl.model.HttpEntity
6+
val HttpEntity: org.apache.pekko.http.scaladsl.model.HttpEntity.type =
7+
org.apache.pekko.http.scaladsl.model.HttpEntity
8+
val StatusCodes: org.apache.pekko.http.scaladsl.model.StatusCodes.type =
9+
org.apache.pekko.http.scaladsl.model.StatusCodes
10+
type HttpRequest = org.apache.pekko.http.scaladsl.model.HttpRequest
11+
val HttpRequest: org.apache.pekko.http.scaladsl.model.HttpRequest.type =
12+
org.apache.pekko.http.scaladsl.model.HttpRequest
13+
type HttpResponse = org.apache.pekko.http.scaladsl.model.HttpResponse
14+
val HttpResponse: org.apache.pekko.http.scaladsl.model.HttpResponse.type =
15+
org.apache.pekko.http.scaladsl.model.HttpResponse
16+
type ContentType = org.apache.pekko.http.scaladsl.model.ContentType
17+
val ContentType: org.apache.pekko.http.scaladsl.model.ContentType.type =
18+
org.apache.pekko.http.scaladsl.model.ContentType
19+
type ContentTypeRange = org.apache.pekko.http.scaladsl.model.ContentTypeRange
20+
val ContentTypeRange
21+
: org.apache.pekko.http.scaladsl.model.ContentTypeRange.type =
22+
org.apache.pekko.http.scaladsl.model.ContentTypeRange
23+
type MediaType = org.apache.pekko.http.scaladsl.model.MediaType
24+
val MediaType: org.apache.pekko.http.scaladsl.model.MediaType.type =
25+
org.apache.pekko.http.scaladsl.model.MediaType
26+
val MediaTypes: org.apache.pekko.http.scaladsl.model.MediaTypes.type =
27+
org.apache.pekko.http.scaladsl.model.MediaTypes
28+
val ContentTypes: org.apache.pekko.http.scaladsl.model.ContentTypes.type =
29+
org.apache.pekko.http.scaladsl.model.ContentTypes
30+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package akka.http.scaladsl
2+
3+
package object server {
4+
5+
type Directives = org.apache.pekko.http.scaladsl.server.Directives
6+
val Directives: org.apache.pekko.http.scaladsl.server.Directives.type =
7+
org.apache.pekko.http.scaladsl.server.Directives
8+
type Route = org.apache.pekko.http.scaladsl.server.Route
9+
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package akka.management.cluster
2+
3+
package object bootstrap {
4+
type ClusterBootstrap =
5+
org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap
6+
val ClusterBootstrap
7+
: org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap.type =
8+
org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package akka.management
2+
3+
package object scaladsl {
4+
val AkkaManagement = org.apache.pekko.management.scaladsl.PekkoManagement
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package akka.http.scaladsl.marshallers
2+
3+
object sprayjson {
4+
type SprayJsonSupport =
5+
org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
6+
val SprayJsonSupport
7+
: org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.type =
8+
org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
9+
}

project/Dependencies.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@ object Dependencies {
88
val cluster = "org.apache.pekko" %% "pekko-cluster" % PekkoVersion
99
val stream = "org.apache.pekko" %% "pekko-stream" % PekkoVersion
1010
val sharding = "org.apache.pekko" %% "pekko-cluster-sharding" % PekkoVersion
11+
val http = "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion
12+
val spray = "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion
13+
val management = "org.apache.pekko" %% "pekko-management" % PekkoHttpVersion
14+
val bootstrap =
15+
"org.apache.pekko" %% "pekko-management-cluster-bootstrap" % PekkoHttpVersion
16+
val `cluster-http` =
17+
"org.apache.pekko" %% "pekko-management-cluster-http" % PekkoHttpVersion
1118
}
1219
}

0 commit comments

Comments
 (0)