Skip to content

Commit

Permalink
no need to cast to ActorMaterializer (apache#351)
Browse files Browse the repository at this point in the history
* no need to cast to ActorMaterializer

* remove imports
  • Loading branch information
pjfanning authored Oct 30, 2023
1 parent 2f94e48 commit 600cf14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import pekko.http.impl.util._
import pekko.http.scaladsl.model._
import pekko.http.scaladsl.Http
import pekko.macros.LogHelper
import pekko.stream.ActorMaterializer
import pekko.stream.Attributes
import pekko.stream.FlowShape
import pekko.stream.Inlet
Expand Down Expand Up @@ -69,7 +68,7 @@ private[http] object PoolInterface {
import poolId.hcps
import hcps._
import setup.{ connectionContext, settings }
implicit val system = fm.asInstanceOf[ActorMaterializer].system
implicit val system = fm.system
val log: LoggingAdapter = Logging(system, poolId)(PoolLogSource)

log.debug("Creating pool.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sealed trait HttpEntity extends jm.HttpEntity {
*/
def toStrict(timeout: FiniteDuration)(implicit fm: Materializer): Future[HttpEntity.Strict] = {
import pekko.http.impl.util._
val config = fm.asInstanceOf[ActorMaterializer].system.settings.config
val config = fm.system.settings.config
toStrict(timeout, config.getPossiblyInfiniteBytes("pekko.http.parsing.max-to-strict-bytes"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package org.apache.pekko.http.impl.util
import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.http.scaladsl.Http
import pekko.stream.{ ActorMaterializer, Materializer, SystemMaterializer }
import pekko.stream.{ Materializer, SystemMaterializer }
import pekko.testkit.PekkoSpec
import pekko.testkit.EventFilter
import com.typesafe.config.ConfigFactory
Expand All @@ -42,7 +42,7 @@ abstract class PekkoSpecWithMaterializer(configOverrides: String)
// shutdown materializer first, otherwise it will only be shutdown during
// main system guardian being shutdown which will be after the logging has
// reverted to stdout logging that cannot be intercepted
materializer.asInstanceOf[ActorMaterializer].shutdown()
materializer.shutdown()
Http().shutdownAllConnectionPools()
// materializer shutdown is async but cannot be watched
Thread.sleep(10)
Expand Down

0 comments on commit 600cf14

Please sign in to comment.