Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@
outerMaterializer: Materializer) =
new GraphStageLogic(shape) {
val parsingErrorHandler: ParsingErrorHandler =
settings.parsingErrorHandlerInstance(ActorMaterializerHelper.downcast(outerMaterializer).system)
settings.parsingErrorHandlerInstance(outerMaterializer.system)
val pullHttpResponseIn = () => tryPull(httpResponseIn)
var openRequests = immutable.Queue[RequestStart]()
var oneHundredContinueResponsePending = false
Expand Down Expand Up @@ -721,7 +721,7 @@
})

private var activeTimers = 0
private def timeout = ActorMaterializerHelper.downcast(materializer).settings.subscriptionTimeoutSettings.timeout
private def timeout = materializer.settings.subscriptionTimeoutSettings.timeout

Check warning on line 724 in http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 8)

method settings in class Materializer is deprecated (since Akka 2.6.0): Use attributes to access settings from stages

Check warning on line 724 in http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 8)

value timeout in class StreamSubscriptionTimeoutSettings is deprecated (since Akka 2.6.0): Use attribute 'ActorAttributes.StreamSubscriptionTimeout' to read the concrete setting value

Check warning on line 724 in http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 11)

method settings in class Materializer is deprecated (since Akka 2.6.0): Use attributes to access settings from stages

Check warning on line 724 in http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 11)

value timeout in class StreamSubscriptionTimeoutSettings is deprecated (since Akka 2.6.0): Use attribute 'ActorAttributes.StreamSubscriptionTimeout' to read the concrete setting value
private def addTimeout(s: SubscriptionTimeout): Unit = {
if (activeTimers == 0) setKeepGoing(true)
activeTimers += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ abstract class BasicDirectives {
D.extractMaterializer { m => inner.apply(m).delegate })

/**
* Extracts the [[pekko.actor.ActorSystem]] if the available Materializer is an [[pekko.stream.ActorMaterializer]].
* Extracts the [[pekko.actor.ActorSystem]] if the Materializer is available.
* Otherwise throws an exception as it won't be able to extract the system from arbitrary materializers.
*/
def extractActorSystem(inner: JFunction[ActorSystem, Route]): Route = RouteAdapter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import pekko.http.scaladsl.server.directives.BasicDirectives
import pekko.http.scaladsl.settings.{ ParserSettings, RoutingSettings }
import pekko.http.scaladsl.util.FastFuture._
import pekko.stream.scaladsl.Flow
import pekko.stream.{ ActorMaterializerHelper, Materializer, SystemMaterializer }
import pekko.stream.{ Materializer, SystemMaterializer }

import scala.concurrent.{ ExecutionContextExecutor, Future }

Expand Down Expand Up @@ -116,7 +116,7 @@ object Route {
exceptionHandler: ExceptionHandler = null): HttpRequest => Future[HttpResponse] = {
val effectiveEC = if (executionContext ne null) executionContext else materializer.executionContext
val effectiveParserSettings = if (parserSettings ne null) parserSettings
else ParserSettings(ActorMaterializerHelper.downcast(materializer).system)
else ParserSettings(materializer.system)
createAsyncHandler(seal(route), routingLog, routingSettings, effectiveParserSettings)(effectiveEC, materializer)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import pekko.actor.ClassicActorSystemProvider
import pekko.http.javadsl
import pekko.http.scaladsl.model.{ HttpRequest, HttpResponse }
import pekko.http.scaladsl.settings.{ ParserSettings, RoutingSettings }
import pekko.stream.{ ActorMaterializerHelper, Materializer }
import pekko.stream.Materializer
import pekko.stream.scaladsl.Flow

import scala.collection.JavaConverters._
Expand Down Expand Up @@ -98,6 +98,6 @@ sealed abstract class LowerPriorityRouteResultImplicits {
@deprecated("make an ActorSystem available implicitly instead", "Akka HTTP 10.2.0")
implicit def routeToFlowViaMaterializer(route: Route)(
implicit materializer: Materializer): Flow[HttpRequest, HttpResponse, NotUsed] =
Route.toFlow(route)(ActorMaterializerHelper.downcast(materializer).system)
Route.toFlow(route)(materializer.system)

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import scala.collection.immutable
import pekko.event.LoggingAdapter
import pekko.http.scaladsl.model.Uri.Path
import pekko.util.ConstantFun.scalaIdentityFunction
import pekko.stream.{ ActorMaterializerHelper, Materializer }
import pekko.stream.Materializer
import pekko.http.scaladsl.settings.{ ParserSettings, RoutingSettings }
import pekko.http.scaladsl.server.util.Tuple
import pekko.http.scaladsl.util.FastFuture
Expand Down Expand Up @@ -266,13 +266,13 @@ trait BasicDirectives {
def extractMaterializer: Directive1[Materializer] = BasicDirectives._extractMaterializer

/**
* Extracts the [[pekko.actor.ActorSystem]] if the available Materializer is an [[pekko.stream.ActorMaterializer]].
* Extracts the [[pekko.actor.ActorSystem]] if the Materializer is available.
* Otherwise throws an exception as it won't be able to extract the system from arbitrary materializers.
*
* @group basic
*/
def extractActorSystem: Directive1[ActorSystem] = extract { ctx =>
ActorMaterializerHelper.downcast(ctx.materializer).system
ctx.materializer.system
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import pekko.http.scaladsl.model._
import pekko.http.scaladsl.settings.ParserSettings
import pekko.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import pekko.http.scaladsl.util.FastFuture
import pekko.stream.ActorMaterializerHelper
import pekko.stream.scaladsl._

import scala.collection.immutable
Expand Down Expand Up @@ -93,7 +92,7 @@ trait MultipartUnmarshallers {
case Some(boundary) =>
import BodyPartParser._
val effectiveParserSettings =
Option(parserSettings).getOrElse(ParserSettings(ActorMaterializerHelper.downcast(mat).system))
Option(parserSettings).getOrElse(ParserSettings(mat.system))
val parser = new BodyPartParser(defaultContentType, boundary, log, effectiveParserSettings)

entity match {
Expand Down
4 changes: 0 additions & 4 deletions project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ object Common extends AutoPlugin {
// Can be removed when we drop support for Scala 2.12:
"-Wconf:msg=object JavaConverters in package collection is deprecated:s",
"-Wconf:msg=is deprecated \\(since 2\\.13\\.:s",
// tolerate deprecations from Akka 2.6.0 until Pekko 1.1.x where we clean up
"-Wconf:cat=deprecation&msg=since Akka 2\\.6\\.:s",
// tolerate deprecations from Akka HTTP 10.2.0 until Pekko 1.1.x where we clean up
"-Wconf:cat=deprecation&msg=since Akka HTTP 10\\.2\\.:s",
"-Wconf:msg=reached max recursion depth:s",
"-release:8"),
scalacOptions ++= onlyOnScala2(Seq(
Expand Down
Loading