Skip to content
Merged
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 @@ private[http] object HttpServerBluePrint {
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[http] object HttpServerBluePrint {
})

private var activeTimers = 0
private def timeout = ActorMaterializerHelper.downcast(materializer).settings.subscriptionTimeoutSettings.timeout
private def timeout = materializer.settings.subscriptionTimeoutSettings.timeout
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
Loading