Skip to content

Commit

Permalink
Merge pull request #276 from mdedetrich/add-stream-capability-for-pekko
Browse files Browse the repository at this point in the history
Add capability for Pekko Streams
  • Loading branch information
adamw authored Jul 20, 2023
2 parents a973886 + bd53ffd commit bf1b59b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ val commonNativeSettings = commonSettings ++ Seq(
)

lazy val allProjectRefs =
core.projectRefs ++ ws.projectRefs ++ akka.projectRefs ++ armeria.projectRefs ++ fs2ce2.projectRefs ++ fs2.projectRefs ++ monix.projectRefs ++ zio1.projectRefs ++ zio.projectRefs ++ vertx.projectRefs
core.projectRefs ++ ws.projectRefs ++ akka.projectRefs ++ pekko.projectRefs ++ armeria.projectRefs ++ fs2ce2.projectRefs ++ fs2.projectRefs ++ monix.projectRefs ++ zio1.projectRefs ++ zio.projectRefs ++ vertx.projectRefs

lazy val projectAggregates: Seq[ProjectReference] = if (sys.env.isDefinedAt("STTP_NATIVE")) {
println("[info] STTP_NATIVE defined, including sttp-native in the aggregate projects")
Expand Down Expand Up @@ -146,6 +146,18 @@ lazy val akka = (projectMatrix in file("akka"))
)
.dependsOn(core)

lazy val pekko = (projectMatrix in file("pekko"))
.settings(
name := "pekko"
)
.jvmPlatform(
scalaVersions = scala2alive ++ scala3,
settings = commonJvmSettings ++ Seq(
libraryDependencies += "org.apache.pekko" %% "pekko-stream" % "1.0.0" % "provided"
)
)
.dependsOn(core)

lazy val armeria = (projectMatrix in file("armeria"))
.settings(
name := "armeria"
Expand Down
12 changes: 12 additions & 0 deletions pekko/src/main/scala/sttp/capabilities/pekko/PekkoStreams.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package sttp.capabilities.pekko

import org.apache.pekko
import pekko.stream.scaladsl.{Flow, Source}
import pekko.util.ByteString
import sttp.capabilities.Streams

trait PekkoStreams extends Streams[PekkoStreams] {
override type BinaryStream = Source[ByteString, Any]
override type Pipe[A, B] = Flow[A, B, Any]
}
object PekkoStreams extends PekkoStreams

0 comments on commit bf1b59b

Please sign in to comment.