scalafix ExplicitResultTypes - for implicit members
This commit is contained in:
parent
2c6e349c7e
commit
02b9b30354
105 changed files with 153 additions and 117 deletions
|
|
@ -1,9 +1,14 @@
|
|||
// .scalafix.conf
|
||||
rules = [
|
||||
RemoveUnused
|
||||
ExplicitResultTypes
|
||||
"github:ohze/scalafix-rules/ConstructorProcedureSyntax"
|
||||
"github:ohze/scalafix-rules/FinalObject"
|
||||
]
|
||||
ExplicitResultTypes {
|
||||
memberVisibility = [] # only rewrite implicit members
|
||||
skipSimpleDefinitions = []
|
||||
}
|
||||
RemoveUnused.imports = true
|
||||
RemoveUnused.privates = false
|
||||
RemoveUnused.locals = false
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import language.postfixOps
|
|||
import akka.testkit._
|
||||
import scala.concurrent.duration._
|
||||
import akka.pattern.{ ask, pipe }
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
object ForwardActorSpec {
|
||||
val ExpectedMessage = "FOO"
|
||||
|
|
@ -29,7 +30,7 @@ object ForwardActorSpec {
|
|||
|
||||
class ForwardActorSpec extends AkkaSpec {
|
||||
import ForwardActorSpec._
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
"A Forward Actor" must {
|
||||
|
||||
"forward actor reference when invoking forward on tell" in {
|
||||
|
|
|
|||
|
|
@ -13,9 +13,10 @@ import scala.concurrent.duration._
|
|||
import akka.testkit.{ AkkaSpec, DefaultTimeout }
|
||||
import akka.pattern.{ ask, pipe }
|
||||
import scala.concurrent.ExecutionException
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class Future2ActorSpec extends AkkaSpec with DefaultTimeout {
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
"The Future2Actor bridge" must {
|
||||
|
||||
"support convenient sending to multiple destinations" in {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class AsyncDnsResolverIntegrationSpec extends AkkaSpec(s"""
|
|||
akka.io.dns.async-dns.ndots = 2
|
||||
""") with DockerBindDnsService with WithLogCapturing {
|
||||
val duration = 10.seconds
|
||||
implicit val timeout = Timeout(duration)
|
||||
implicit val timeout: Timeout = Timeout(duration)
|
||||
|
||||
val hostPort = AsyncDnsResolverIntegrationSpec.dockerDnsServerPort
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class AsyncDnsResolverSpec extends AkkaSpec("""
|
|||
val dnsClient2 = TestProbe()
|
||||
val r = resolver(List(dnsClient1.ref, dnsClient2.ref), defaultConfig)
|
||||
val senderProbe = TestProbe()
|
||||
implicit val sender = senderProbe.ref
|
||||
implicit val sender: ActorRef = senderProbe.ref
|
||||
}
|
||||
|
||||
"Async DNS Resolver" must {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@ import akka.testkit._
|
|||
import scala.collection.immutable
|
||||
import scala.concurrent.duration._
|
||||
import scala.concurrent.{ Await, Future }
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class CircuitBreakerMTSpec extends AkkaSpec {
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
"A circuit breaker being called by many threads" must {
|
||||
val callTimeout = 2.second.dilated
|
||||
val resetTimeout = 3.seconds.dilated
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import scala.language.postfixOps
|
|||
import scala.util.Failure
|
||||
import scala.util.Success
|
||||
import scala.util.Try
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
object CircuitBreakerSpec {
|
||||
|
||||
|
|
@ -83,7 +84,7 @@ object CircuitBreakerSpec {
|
|||
|
||||
class CircuitBreakerSpec extends AkkaSpec {
|
||||
import CircuitBreakerSpec._
|
||||
implicit def ec = system.dispatcher
|
||||
implicit def ec: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
val awaitTimeout = 2.seconds.dilated
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import akka.testkit.{ AkkaSpec, TestLatch }
|
|||
import akka.actor.{ Actor, Props }
|
||||
import scala.concurrent.{ Await, Future, Promise }
|
||||
import scala.concurrent.duration._
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
object PatternSpec {
|
||||
final case class Work(duration: Duration)
|
||||
|
|
@ -22,7 +23,7 @@ object PatternSpec {
|
|||
}
|
||||
|
||||
class PatternSpec extends AkkaSpec {
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
import PatternSpec._
|
||||
|
||||
"pattern.gracefulStop" must {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import akka.routing.ConsistentHashingRouter.ConsistentHashableEnvelope
|
|||
import akka.routing.ConsistentHashingRouter.ConsistentHashMapping
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.testkit._
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
object ConsistentHashingRouterSpec {
|
||||
|
||||
|
|
@ -56,7 +57,7 @@ class ConsistentHashingRouterSpec
|
|||
with DefaultTimeout
|
||||
with ImplicitSender {
|
||||
import ConsistentHashingRouterSpec._
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
val router1 = system.actorOf(FromConfig.props(Props[Echo]), "router1")
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import scala.concurrent.Await
|
|||
import akka.ConfigurationException
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import akka.pattern.{ ask, pipe }
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
object RoutingSpec {
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ object RoutingSpec {
|
|||
}
|
||||
|
||||
class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with ImplicitSender {
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
import RoutingSpec._
|
||||
|
||||
muteDeadLetters(classOf[akka.dispatch.sysmsg.DeathWatchNotification])(system)
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ class SerializeSpec extends AkkaSpec(SerializationTests.serializeConf) {
|
|||
}
|
||||
|
||||
class VerifySerializabilitySpec extends AkkaSpec(SerializationTests.verifySerializabilityConf) {
|
||||
implicit val timeout = Timeout(5 seconds)
|
||||
implicit val timeout: Timeout = Timeout(5 seconds)
|
||||
|
||||
"verify config" in {
|
||||
system.settings.SerializeAllCreators should ===(true)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ import scala.collection.mutable.Builder
|
|||
|
||||
class ByteStringSpec extends AnyWordSpec with Matchers with Checkers {
|
||||
|
||||
implicit val betterGeneratorDrivenConfig = PropertyCheckConfiguration().copy(minSuccessful = 1000)
|
||||
implicit val betterGeneratorDrivenConfig: PropertyCheckConfiguration =
|
||||
PropertyCheckConfiguration().copy(minSuccessful = 1000)
|
||||
|
||||
def genSimpleByteString(min: Int, max: Int) =
|
||||
for {
|
||||
|
|
@ -57,7 +58,7 @@ class ByteStringSpec extends AnyWordSpec with Matchers with Checkers {
|
|||
|
||||
case class ByteStringGrouped(bs: ByteString, size: Int)
|
||||
|
||||
implicit val arbitraryByteStringGrouped = Arbitrary {
|
||||
implicit val arbitraryByteStringGrouped: Arbitrary[ByteStringGrouped] = Arbitrary {
|
||||
for {
|
||||
xs <- arbitraryByteString.arbitrary
|
||||
size <- Gen.choose(1, 1 max xs.length)
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@ import scala.concurrent.Await
|
|||
import scala.util.Random
|
||||
import akka.testkit.DefaultTimeout
|
||||
import org.scalatest.matchers.should.Matchers
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout {
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
private def emptyIndex =
|
||||
new Index[String, Int](100, new Comparator[Int] {
|
||||
override def compare(a: Int, b: Int): Int = Integer.compare(a, b)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ object DeferredSpec {
|
|||
class DeferredSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
|
||||
|
||||
import DeferredSpec._
|
||||
implicit val testSettings = TestKitSettings(system)
|
||||
implicit val testSettings: TestKitSettings = TestKitSettings(system)
|
||||
|
||||
"Deferred behavior" must {
|
||||
"must create underlying" in {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ object SpawnProtocolSpec {
|
|||
class SpawnProtocolSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
|
||||
|
||||
import SpawnProtocolSpec._
|
||||
implicit val testSettings = TestKitSettings(system)
|
||||
implicit val testSettings: TestKitSettings = TestKitSettings(system)
|
||||
|
||||
"Spawn behavior" must {
|
||||
"spawn child actor" in {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import scala.concurrent.duration._
|
|||
import akka.actor.testkit.typed.scaladsl.LoggingTestKit
|
||||
import akka.actor.testkit.typed.scaladsl.LogCapturing
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
import akka.actor
|
||||
|
||||
object TransformMessagesSpec {
|
||||
|
||||
|
|
@ -35,7 +36,7 @@ object TransformMessagesSpec {
|
|||
|
||||
class TransformMessagesSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
|
||||
|
||||
implicit val classicSystem = system.toClassic
|
||||
implicit val classicSystem: actor.ActorSystem = system.toClassic
|
||||
|
||||
def intToString(probe: ActorRef[String]): Behavior[Int] = {
|
||||
Behaviors
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import akka.actor.testkit.typed.scaladsl.LoggingTestKit
|
|||
import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit
|
||||
import akka.actor.testkit.typed.scaladsl.LogCapturing
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
import akka.actor
|
||||
|
||||
object WatchSpec {
|
||||
|
||||
|
|
@ -45,7 +46,7 @@ object WatchSpec {
|
|||
|
||||
class WatchSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
|
||||
|
||||
implicit def classicSystem = system.toClassic
|
||||
implicit def classicSystem: actor.ActorSystem = system.toClassic
|
||||
|
||||
import WatchSpec._
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class ClassicSupervisingTypedSpec extends AnyWordSpecLike with LogCapturing with
|
|||
akka.actor.testkit.typed.expect-no-message-default = 50 ms
|
||||
"""))
|
||||
val classicTestKit = new akka.testkit.TestKit(classicSystem)
|
||||
implicit val classicSender = classicTestKit.testActor
|
||||
implicit val classicSender: u.ActorRef = classicTestKit.testActor
|
||||
import classicTestKit._
|
||||
|
||||
"A classic actor system that spawns typed actors" should {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class ActorSystemSpec
|
|||
with Eventually
|
||||
with LogCapturing {
|
||||
|
||||
override implicit val patienceConfig = PatienceConfig(1.second)
|
||||
override implicit val patienceConfig: PatienceConfig = PatienceConfig(1.second)
|
||||
def system[T](behavior: Behavior[T], name: String) = ActorSystem(behavior, name)
|
||||
def suite = "adapter"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory
|
|||
import org.slf4j.MDC
|
||||
import org.slf4j.helpers.BasicMarkerFactory
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
import akka.actor.ActorSystem
|
||||
|
||||
class SomeClass
|
||||
|
||||
|
|
@ -57,7 +58,7 @@ class ActorLoggingSpec extends ScalaTestWithActorTestKit("""
|
|||
val marker = new BasicMarkerFactory().getMarker("marker")
|
||||
val cause = TestException("böö")
|
||||
|
||||
implicit val classic = system.toClassic
|
||||
implicit val classic: ActorSystem = system.toClassic
|
||||
|
||||
class AnotherLoggerClass
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit
|
|||
import akka.actor.testkit.typed.scaladsl.TestProbe
|
||||
import akka.actor.testkit.typed.scaladsl.LogCapturing
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class ReceivePartialSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing {
|
||||
|
||||
implicit val ec = system.executionContext
|
||||
implicit val ec: ExecutionContextExecutor = system.executionContext
|
||||
|
||||
"An immutable partial" must {
|
||||
"correctly install the receiveMessage handler" in {
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ object AdapterSpec {
|
|||
class AdapterSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with LogCapturing {
|
||||
import AdapterSpec._
|
||||
|
||||
implicit val system = akka.actor.ActorSystem("AdapterSpec")
|
||||
implicit val system: classic.ActorSystem = akka.actor.ActorSystem("AdapterSpec")
|
||||
def typedSystem: ActorSystem[Nothing] = system.toTyped
|
||||
|
||||
"ActorSystem adaption" must {
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ trait Actor {
|
|||
* self ! message
|
||||
* </pre>
|
||||
*/
|
||||
implicit final val self = context.self //MUST BE A VAL, TRUST ME
|
||||
implicit final val self: ActorRef = context.self //MUST BE A VAL, TRUST ME
|
||||
|
||||
/**
|
||||
* The reference sender Actor of the last received message.
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import akka.routing.{ Deafen, Listen, Listeners }
|
|||
import akka.annotation.InternalApi
|
||||
import akka.util.{ unused, JavaDurationConverters }
|
||||
import com.github.ghik.silencer.silent
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
object FSM {
|
||||
|
||||
|
|
@ -121,7 +122,7 @@ object FSM {
|
|||
extends NoSerializationVerificationNeeded {
|
||||
private var ref: Option[Cancellable] = _
|
||||
private val scheduler = context.system.scheduler
|
||||
private implicit val executionContext = context.dispatcher
|
||||
private implicit val executionContext: ExecutionContextExecutor = context.dispatcher
|
||||
|
||||
def schedule(actor: ActorRef, timeout: FiniteDuration): Unit = {
|
||||
val timerMsg = msg match {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import java.io.ObjectStreamException
|
|||
import java.lang.reflect.{ InvocationHandler, InvocationTargetException, Method, Proxy }
|
||||
|
||||
import com.github.ghik.silencer.silent
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
/**
|
||||
* A TypedActorFactory is something that can created TypedActor instances.
|
||||
|
|
@ -252,7 +253,7 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
|
|||
/**
|
||||
* Returns the default dispatcher (for a TypedActor) when inside a method call in a TypedActor.
|
||||
*/
|
||||
implicit def dispatcher = context.dispatcher
|
||||
implicit def dispatcher: ExecutionContextExecutor = context.dispatcher
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class EventStream(sys: ActorSystem, private val debug: Boolean) extends LoggingB
|
|||
/** Either the list of subscribed actors, or a ref to an [[akka.event.EventStreamUnsubscriber]] */
|
||||
private val initiallySubscribedOrUnsubscriber = new AtomicReference[Either[Set[ActorRef], ActorRef]](Left(Set.empty))
|
||||
|
||||
protected implicit val subclassification = new Subclassification[Class[_]] {
|
||||
protected implicit val subclassification: Subclassification[Classifier] = new Subclassification[Class[_]] {
|
||||
def isEqual(x: Class[_], y: Class[_]) = x == y
|
||||
def isSubclass(x: Class[_], y: Class[_]) = y.isAssignableFrom(x)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.github.ghik.silencer.silent
|
|||
import com.typesafe.config.Config
|
||||
|
||||
import scala.concurrent.duration.Duration
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -62,10 +63,10 @@ private[io] final class AsyncDnsManager(
|
|||
ext.Settings.Dispatcher,
|
||||
ext.provider)
|
||||
|
||||
implicit val ec = context.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = context.dispatcher
|
||||
|
||||
val settings = new DnsSettings(system, resolverConfig)
|
||||
implicit val timeout = Timeout(settings.ResolveTimeout)
|
||||
implicit val timeout: Timeout = Timeout(settings.ResolveTimeout)
|
||||
|
||||
private val resolver = {
|
||||
val props: Props = FromConfig.props(
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import scala.collection.immutable
|
|||
import scala.concurrent.Future
|
||||
import scala.util.Try
|
||||
import scala.util.control.NonFatal
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -36,10 +37,10 @@ private[io] final class AsyncDnsResolver(
|
|||
|
||||
import AsyncDnsResolver._
|
||||
|
||||
implicit val ec = context.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = context.dispatcher
|
||||
|
||||
// For ask to DNS Client
|
||||
implicit val timeout = Timeout(settings.ResolveTimeout)
|
||||
implicit val timeout: Timeout = Timeout(settings.ResolveTimeout)
|
||||
|
||||
val nameServers = settings.NameServers
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class TypedActorBenchmark {
|
|||
|
||||
implicit var system: ActorSystem[Start] = _
|
||||
|
||||
implicit val askTimeout = akka.util.Timeout(timeout)
|
||||
implicit val askTimeout: akka.util.Timeout = akka.util.Timeout(timeout)
|
||||
|
||||
@Setup(Level.Trial)
|
||||
def setup(): Unit = {
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class ReliableDeliveryBenchmark {
|
|||
|
||||
implicit var system: ActorSystem[Guardian.Command] = _
|
||||
|
||||
implicit val askTimeout = akka.util.Timeout(timeout)
|
||||
implicit val askTimeout: akka.util.Timeout = akka.util.Timeout(timeout)
|
||||
|
||||
@Setup(Level.Trial)
|
||||
def setup(): Unit = {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ mailbox {
|
|||
mailbox-capacity = 1000000
|
||||
}
|
||||
""").withFallback(ConfigFactory.load())
|
||||
implicit val sys = ActorSystem("ANQ", config)
|
||||
implicit val sys: ActorSystem = ActorSystem("ANQ", config)
|
||||
val ref = sys.actorOf(Props(new Actor {
|
||||
def receive = {
|
||||
case Stop => sender() ! Stop
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class SendQueueBenchmark {
|
|||
val config = ConfigFactory.parseString("""
|
||||
""")
|
||||
|
||||
implicit val system = ActorSystem("SendQueueBenchmark", config)
|
||||
implicit val system: ActorSystem = ActorSystem("SendQueueBenchmark", config)
|
||||
|
||||
@Setup
|
||||
def setup(): Unit = {
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ class AskBenchmark {
|
|||
}
|
||||
""")
|
||||
|
||||
implicit val system = ActorSystem("MapAsyncBenchmark", config)
|
||||
implicit val system: ActorSystem = ActorSystem("MapAsyncBenchmark", config)
|
||||
import system.dispatcher
|
||||
|
||||
var testSource: Source[java.lang.Integer, NotUsed] = _
|
||||
|
||||
var actor: ActorRef = _
|
||||
|
||||
implicit val timeout = Timeout(10.seconds)
|
||||
implicit val timeout: Timeout = Timeout(10.seconds)
|
||||
|
||||
@Param(Array("1", "4"))
|
||||
var parallelism = 0
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import scala.concurrent.duration._
|
|||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@BenchmarkMode(Array(Mode.Throughput))
|
||||
class EmptySourceBenchmark {
|
||||
implicit val system = ActorSystem("EmptySourceBenchmark")
|
||||
implicit val system: ActorSystem = ActorSystem("EmptySourceBenchmark")
|
||||
|
||||
@TearDown
|
||||
def shutdown(): Unit = {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import scala.concurrent.duration._
|
|||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@BenchmarkMode(Array(Mode.Throughput))
|
||||
class FlatMapMergeBenchmark {
|
||||
implicit val system = ActorSystem("FlatMapMergeBenchmark")
|
||||
implicit val system: ActorSystem = ActorSystem("FlatMapMergeBenchmark")
|
||||
|
||||
val NumberOfElements = 100000
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class FlowMapBenchmark {
|
|||
}
|
||||
}""".stripMargin).withFallback(ConfigFactory.load())
|
||||
|
||||
implicit val system = ActorSystem("test", config)
|
||||
implicit val system: ActorSystem = ActorSystem("test", config)
|
||||
|
||||
@Param(Array("true", "false"))
|
||||
var UseGraphStageIdentity = false
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class IdentityStage extends GraphStage[FlowShape[MutableElement, MutableElement]
|
|||
class FusedGraphsBenchmark {
|
||||
import FusedGraphsBenchmark._
|
||||
|
||||
implicit val system = ActorSystem(
|
||||
implicit val system: ActorSystem = ActorSystem(
|
||||
"test",
|
||||
ConfigFactory.parseString(s"""
|
||||
akka.stream.materializer.sync-processing-limit = ${Int.MaxValue}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import scala.concurrent.duration._
|
|||
@OutputTimeUnit(TimeUnit.SECONDS)
|
||||
@BenchmarkMode(Array(Mode.Throughput))
|
||||
class InvokeWithFeedbackBenchmark {
|
||||
implicit val system = ActorSystem("InvokeWithFeedbackBenchmark")
|
||||
implicit val system: ActorSystem = ActorSystem("InvokeWithFeedbackBenchmark")
|
||||
|
||||
var sourceQueue: SourceQueueWithComplete[Int] = _
|
||||
var sinkQueue: SinkQueueWithCancel[Int] = _
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class MapAsyncBenchmark {
|
|||
}
|
||||
""")
|
||||
|
||||
implicit val system = ActorSystem("MapAsyncBenchmark", config)
|
||||
implicit val system: ActorSystem = ActorSystem("MapAsyncBenchmark", config)
|
||||
import system.dispatcher
|
||||
|
||||
var testSource: Source[java.lang.Integer, NotUsed] = _
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class MaterializationBenchmark {
|
|||
|
||||
import MaterializationBenchmark._
|
||||
|
||||
implicit val system = ActorSystem("MaterializationBenchmark")
|
||||
implicit val system: ActorSystem = ActorSystem("MaterializationBenchmark")
|
||||
|
||||
var flowWithMap: RunnableGraph[NotUsed] = _
|
||||
var graphWithJunctionsGradual: RunnableGraph[NotUsed] = _
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class PartitionHubBenchmark {
|
|||
}
|
||||
""")
|
||||
|
||||
implicit val system = ActorSystem("PartitionHubBenchmark", config)
|
||||
implicit val system: ActorSystem = ActorSystem("PartitionHubBenchmark", config)
|
||||
|
||||
@Param(Array("2", "5", "10", "20", "30"))
|
||||
var NumberOfStreams = 0
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class SourceRefBenchmark {
|
|||
loglevel = "WARNING"
|
||||
}""".stripMargin).withFallback(ConfigFactory.load())
|
||||
|
||||
implicit val system = ActorSystem("test", config)
|
||||
implicit val system: ActorSystem = ActorSystem("test", config)
|
||||
|
||||
final val successMarker = Success(1)
|
||||
final val successFailure = Success(new Exception)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ object OutputStreamSourceStageBenchmark {
|
|||
@BenchmarkMode(Array(Mode.Throughput))
|
||||
class OutputStreamSourceStageBenchmark {
|
||||
import OutputStreamSourceStageBenchmark.WritesPerBench
|
||||
implicit val system = ActorSystem("OutputStreamSourceStageBenchmark")
|
||||
implicit val system: ActorSystem = ActorSystem("OutputStreamSourceStageBenchmark")
|
||||
|
||||
private val bytes: Array[Byte] = Array.emptyByteArray
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import scala.concurrent.Promise
|
|||
@BenchmarkMode(Array(Mode.AverageTime))
|
||||
class FileSourcesBenchmark {
|
||||
|
||||
implicit val system = ActorSystem("file-sources-benchmark")
|
||||
implicit val system: ActorSystem = ActorSystem("file-sources-benchmark")
|
||||
|
||||
val file: Path = {
|
||||
val line = ByteString("x" * 2048 + "\n")
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class FileSourcesScaleBenchmark {
|
|||
* FileSourcesScaleBenchmark.flatMapMerge 2048 avgt 10 1.587 ± 0.118 s/op
|
||||
* FileSourcesScaleBenchmark.mapAsync 2048 avgt 10 0.899 ± 0.103 s/op
|
||||
*/
|
||||
implicit val system = ActorSystem("file-sources-benchmark")
|
||||
implicit val system: ActorSystem = ActorSystem("file-sources-benchmark")
|
||||
|
||||
val FILES_NUMBER = 40
|
||||
val files: Seq[Path] = {
|
||||
|
|
|
|||
|
|
@ -780,8 +780,8 @@ private[akka] class DDataShard(
|
|||
private val writeMajority = WriteMajority(settings.tuningParameters.updatingStateTimeout, majorityMinCap)
|
||||
private val maxUpdateAttempts = 3
|
||||
|
||||
implicit private val node = Cluster(context.system)
|
||||
implicit private val selfUniqueAddress = SelfUniqueAddress(node.selfUniqueAddress)
|
||||
implicit private val node: Cluster = Cluster(context.system)
|
||||
implicit private val selfUniqueAddress: SelfUniqueAddress = SelfUniqueAddress(node.selfUniqueAddress)
|
||||
|
||||
// The default maximum-frame-size is 256 KiB with Artery.
|
||||
// When using entity identifiers with 36 character strings (e.g. UUID.randomUUID).
|
||||
|
|
|
|||
|
|
@ -1100,8 +1100,8 @@ class DDataShardCoordinator(
|
|||
private val readMajority = ReadMajority(settings.tuningParameters.waitingForStateTimeout, majorityMinCap)
|
||||
private val writeMajority = WriteMajority(settings.tuningParameters.updatingStateTimeout, majorityMinCap)
|
||||
|
||||
implicit val node = Cluster(context.system)
|
||||
private implicit val selfUniqueAddress = SelfUniqueAddress(node.selfUniqueAddress)
|
||||
implicit val node: Cluster = Cluster(context.system)
|
||||
private implicit val selfUniqueAddress: SelfUniqueAddress = SelfUniqueAddress(node.selfUniqueAddress)
|
||||
val CoordinatorStateKey = LWWRegisterKey[State](s"${typeName}CoordinatorState")
|
||||
val initEmptyState = State.empty.withRememberEntities(settings.rememberEntities)
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import akka.pattern.ask
|
|||
import scala.concurrent.Future
|
||||
import scala.compat.java8.FutureConverters._
|
||||
import akka.util.JavaDurationConverters._
|
||||
import akka.dispatch.MessageDispatcher
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -55,8 +56,8 @@ final private[external] class ExternalShardAllocationClientImpl(system: ActorSys
|
|||
system.settings.config
|
||||
.getDuration("akka.cluster.sharding.external-shard-allocation-strategy.client-timeout")
|
||||
.asScala
|
||||
private implicit val askTimeout = Timeout(timeout * 2)
|
||||
private implicit val ec = system.dispatchers.internalDispatcher
|
||||
private implicit val askTimeout: Timeout = Timeout(timeout * 2)
|
||||
private implicit val ec: MessageDispatcher = system.dispatchers.internalDispatcher
|
||||
|
||||
private val Key = ExternalShardAllocationStrategy.ddataKey(typeName)
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ object ClusterShardingCustomShardAllocationSpec {
|
|||
}
|
||||
|
||||
case class TestAllocationStrategy(ref: ActorRef) extends ShardAllocationStrategy {
|
||||
implicit val timeout = Timeout(3.seconds)
|
||||
implicit val timeout: Timeout = Timeout(3.seconds)
|
||||
override def allocateShard(
|
||||
requester: ActorRef,
|
||||
shardId: ShardRegion.ShardId,
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class TestLeaseActorClient(settings: LeaseSettings, system: ExtendedActorSystem)
|
|||
log.info("lease created {}", settings)
|
||||
leaseActor ! Create(settings.leaseName, settings.ownerName)
|
||||
|
||||
private implicit val timeout = Timeout(100.seconds)
|
||||
private implicit val timeout: Timeout = Timeout(100.seconds)
|
||||
|
||||
override def acquire(): Future[Boolean] = {
|
||||
(leaseActor ? Acquire(settings.ownerName)).mapTo[Boolean]
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ private[typed] object ClusterReceptionist extends ReceptionistBehaviorProvider {
|
|||
val cluster = Cluster(classicSystem)
|
||||
// don't use DistributedData.selfUniqueAddress here, because that will initialize extension, which
|
||||
// isn't used otherwise by the ClusterReceptionist
|
||||
implicit val selfNodeAddress = SelfUniqueAddress(cluster.selfUniqueAddress)
|
||||
implicit val selfNodeAddress: SelfUniqueAddress = SelfUniqueAddress(cluster.selfUniqueAddress)
|
||||
|
||||
val replicator = ctx.actorOf(Replicator.props(settings.replicatorSettings), "replicator")
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class ClusterSingletonApiSpec
|
|||
with LogCapturing {
|
||||
import ClusterSingletonApiSpec._
|
||||
|
||||
implicit val testSettings = TestKitSettings(system)
|
||||
implicit val testSettings: TestKitSettings = TestKitSettings(system)
|
||||
val clusterNode1 = Cluster(system)
|
||||
val classicSystem1 = system.toClassic
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class ClusterSingletonPoisonPillSpec
|
|||
with AnyWordSpecLike
|
||||
with LogCapturing {
|
||||
|
||||
implicit val testSettings = TestKitSettings(system)
|
||||
implicit val testSettings: TestKitSettings = TestKitSettings(system)
|
||||
val clusterNode1 = Cluster(system)
|
||||
clusterNode1.manager ! Join(clusterNode1.selfMember.address)
|
||||
val classicSystem1 = system.toClassic
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ object StreamRefSpec extends MultiNodeConfig {
|
|||
|
||||
class DataSource(streamLifecycleProbe: ActorRef) extends Actor with ActorLogging {
|
||||
import context.dispatcher
|
||||
implicit val mat = Materializer(context)
|
||||
implicit val mat: Materializer = Materializer(context)
|
||||
|
||||
def receive = {
|
||||
case RequestLogs(streamId) =>
|
||||
|
|
@ -102,7 +102,7 @@ object StreamRefSpec extends MultiNodeConfig {
|
|||
class DataReceiver(streamLifecycleProbe: ActorRef) extends Actor with ActorLogging {
|
||||
|
||||
import context.dispatcher
|
||||
implicit val mat = Materializer(context)
|
||||
implicit val mat: Materializer = Materializer(context)
|
||||
|
||||
def receive = {
|
||||
case PrepareUpload(nodeId) =>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import akka.util.ccompat.JavaConverters._
|
|||
import scala.concurrent.Future
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
import scala.util.control.NonFatal
|
||||
import akka.dispatch.MessageDispatcher
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -55,7 +56,7 @@ private[akka] final class AggregateServiceDiscovery(system: ExtendedActorSystem)
|
|||
val serviceDiscovery = Discovery(system)
|
||||
settings.discoveryMethods.map(mech => (mech, serviceDiscovery.loadServiceDiscovery(mech)))
|
||||
}
|
||||
private implicit val ec = system.dispatchers.internalDispatcher
|
||||
private implicit val ec: MessageDispatcher = system.dispatchers.internalDispatcher
|
||||
|
||||
/**
|
||||
* Each discovery method is given the resolveTimeout rather than reducing it each time between methods.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import akka.io.dns.internal.AsyncDnsManager
|
|||
import akka.pattern.AskTimeoutException
|
||||
import akka.util.OptionVal
|
||||
import akka.util.Timeout
|
||||
import akka.dispatch.MessageDispatcher
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -91,7 +92,7 @@ private[akka] class DnsServiceDiscovery(system: ExtendedActorSystem) extends Ser
|
|||
// (eventually visible)
|
||||
private var asyncDnsCache: OptionVal[SimpleDnsCache] = OptionVal.None
|
||||
|
||||
private implicit val ec = system.dispatchers.internalDispatcher
|
||||
private implicit val ec: MessageDispatcher = system.dispatchers.internalDispatcher
|
||||
|
||||
dns.ask(AsyncDnsManager.GetCache)(Timeout(30.seconds)).onComplete {
|
||||
case Success(cache: SimpleDnsCache) =>
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val timeout = 14.seconds.dilated // initialization of lmdb can be very slow in CI environment
|
||||
val writeTwo = WriteTo(2, timeout)
|
||||
val readTwo = ReadFrom(2, timeout)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class DurablePruningSpec extends MultiNodeSpec(DurablePruningSpec) with STMultiN
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val maxPruningDissemination = 3.seconds
|
||||
|
||||
def startReplicator(sys: ActorSystem): ActorRef =
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class JepsenInspiredInsertSpec
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val replicator = DistributedData(system).replicator
|
||||
val nodes = roles.drop(1) // controller not part of active nodes
|
||||
val nodeCount = nodes.size
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val replicator = DistributedData(system).replicator
|
||||
val timeout = 3.seconds.dilated
|
||||
val factor = 1 // use 3 here for serious tuning
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class ReplicatorChaosSpec extends MultiNodeSpec(ReplicatorChaosSpec) with STMult
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val replicator = system.actorOf(
|
||||
Replicator.props(ReplicatorSettings(system).withRole("backend").withGossipInterval(1.second)),
|
||||
"replicator")
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class ReplicatorDeltaSpec extends MultiNodeSpec(ReplicatorDeltaSpec) with STMult
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val fullStateReplicator = system.actorOf(
|
||||
Replicator.props(ReplicatorSettings(system).withGossipInterval(1.second).withDeltaCrdtEnabled(false)),
|
||||
"fullStateReplicator")
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class ReplicatorMapDeltaSpec extends MultiNodeSpec(ReplicatorMapDeltaSpec) with
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val fullStateReplicator = system.actorOf(
|
||||
Replicator.props(ReplicatorSettings(system).withGossipInterval(1.second).withDeltaCrdtEnabled(false)),
|
||||
"fullStateReplicator")
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ReplicatorORSetDeltaSpec
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val replicator =
|
||||
system.actorOf(Replicator.props(ReplicatorSettings(system).withGossipInterval(1.second)), "replicator")
|
||||
val timeout = 3.seconds.dilated
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ReplicatorPruningSpec extends MultiNodeSpec(ReplicatorPruningSpec) with ST
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val maxPruningDissemination = 3.seconds
|
||||
val replicator = system.actorOf(
|
||||
Replicator.props(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class ReplicatorSpec extends MultiNodeSpec(ReplicatorSpec) with STMultiNodeSpec
|
|||
override def initialParticipants = roles.size
|
||||
|
||||
val cluster = Cluster(system)
|
||||
implicit val selfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(system).selfUniqueAddress
|
||||
val replicator = system.actorOf(
|
||||
Replicator.props(ReplicatorSettings(system).withGossipInterval(1.second).withMaxDeltaElements(10)),
|
||||
"replicator")
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ object LocalConcurrencySpec {
|
|||
|
||||
class Updater extends Actor with Stash {
|
||||
|
||||
implicit val selfUniqueAddress = DistributedData(context.system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(context.system).selfUniqueAddress
|
||||
|
||||
val replicator = DistributedData(context.system).replicator
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class LotsOfDataBot extends Actor with ActorLogging {
|
|||
import LotsOfDataBot._
|
||||
import Replicator._
|
||||
|
||||
implicit val selfUniqueAddress = DistributedData(context.system).selfUniqueAddress
|
||||
implicit val selfUniqueAddress: SelfUniqueAddress = DistributedData(context.system).selfUniqueAddress
|
||||
val replicator = DistributedData(context.system).replicator
|
||||
|
||||
import context.dispatcher
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ trait Conductor { this: TestConductorExt =>
|
|||
private[akka] class ConductorHandler(_createTimeout: Timeout, controller: ActorRef, log: LoggingAdapter)
|
||||
extends SimpleChannelUpstreamHandler {
|
||||
|
||||
implicit val createTimeout = _createTimeout
|
||||
implicit val createTimeout: Timeout = _createTimeout
|
||||
val clients = new ConcurrentHashMap[Channel, ActorRef]()
|
||||
|
||||
override def channelConnected(ctx: ChannelHandlerContext, event: ChannelStateEvent) = {
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ class TestConductorExt(val system: ExtendedActorSystem) extends Extension with C
|
|||
val ClientReconnects = config.getInt("client-reconnects")
|
||||
val ReconnectBackoff = config.getMillisDuration("reconnect-backoff")
|
||||
|
||||
implicit val BarrierTimeout = Timeout(config.getMillisDuration("barrier-timeout"))
|
||||
implicit val QueryTimeout = Timeout(config.getMillisDuration("query-timeout"))
|
||||
implicit val BarrierTimeout: Timeout = Timeout(config.getMillisDuration("barrier-timeout"))
|
||||
implicit val QueryTimeout: Timeout = Timeout(config.getMillisDuration("query-timeout"))
|
||||
val PacketSplitThreshold = config.getMillisDuration("packet-split-threshold")
|
||||
|
||||
private def computeWPS(config: Config): Int =
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ abstract class SnapshotStoreSpec(config: Config)
|
|||
with MayVerb
|
||||
with OptionalTests
|
||||
with SnapshotStoreCapabilityFlags {
|
||||
implicit lazy val system = ActorSystem("SnapshotStoreSpec", config.withFallback(SnapshotStoreSpec.config))
|
||||
implicit lazy val system: ActorSystem =
|
||||
ActorSystem("SnapshotStoreSpec", config.withFallback(SnapshotStoreSpec.config))
|
||||
|
||||
private var senderProbe: TestProbe = _
|
||||
private var metadata: Seq[SnapshotMetadata] = Nil
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import akka.persistence.typed.scaladsl.Effect
|
|||
import akka.persistence.typed.scaladsl.EventSourcedBehavior
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
import akka.actor
|
||||
import akka.actor.typed.ActorSystem
|
||||
|
||||
object ClusterSingletonPersistenceSpec {
|
||||
val config = ConfigFactory.parseString("""
|
||||
|
|
@ -57,9 +59,9 @@ class ClusterSingletonPersistenceSpec
|
|||
import ClusterSingletonPersistenceSpec._
|
||||
import akka.actor.typed.scaladsl.adapter._
|
||||
|
||||
implicit val s = system
|
||||
implicit val s: ActorSystem[Nothing] = system
|
||||
|
||||
implicit val classicSystem = system.toClassic
|
||||
implicit val classicSystem: actor.ActorSystem = system.toClassic
|
||||
private val classicCluster = akka.cluster.Cluster(classicSystem)
|
||||
|
||||
"A typed cluster singleton with persistent actor" must {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import akka.actor.testkit.typed.scaladsl.LogCapturing
|
|||
import akka.persistence.typed.PersistenceId
|
||||
import akka.persistence.typed.RecoveryCompleted
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
import akka.actor.ActorSystem
|
||||
|
||||
object RecoveryPermitterSpec {
|
||||
|
||||
|
|
@ -76,7 +77,7 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s"""
|
|||
|
||||
import RecoveryPermitterSpec._
|
||||
|
||||
implicit val classicSystem = system.toClassic
|
||||
implicit val classicSystem: ActorSystem = system.toClassic
|
||||
|
||||
private val permitter = Persistence(classicSystem).recoveryPermitter
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class NullEmptyStateSpec
|
|||
with AnyWordSpecLike
|
||||
with LogCapturing {
|
||||
|
||||
implicit val testSettings = TestKitSettings(system)
|
||||
implicit val testSettings: TestKitSettings = TestKitSettings(system)
|
||||
|
||||
def primitiveState(persistenceId: PersistenceId, probe: ActorRef[String]): Behavior[String] =
|
||||
EventSourcedBehavior[String, String, String](
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import scala.annotation.varargs
|
|||
import scala.collection.immutable
|
||||
import scala.concurrent.duration._
|
||||
import scala.reflect.ClassTag
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
/**
|
||||
* SnapshotAfter Extension Id and factory for creating SnapshotAfter extension
|
||||
|
|
@ -331,7 +332,7 @@ object PersistentFSM {
|
|||
extends NoSerializationVerificationNeeded {
|
||||
private var ref: Option[Cancellable] = _
|
||||
private val scheduler = context.system.scheduler
|
||||
private implicit val executionContext = context.dispatcher
|
||||
private implicit val executionContext: ExecutionContextExecutor = context.dispatcher
|
||||
|
||||
def schedule(actor: ActorRef, timeout: FiniteDuration): Unit = {
|
||||
val timerMsg = msg match {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ object FailureDetector {
|
|||
// Abstract class to be able to extend it from Java
|
||||
abstract class Clock extends (() => Long)
|
||||
|
||||
implicit val defaultClock = new Clock {
|
||||
implicit val defaultClock: Clock = new Clock {
|
||||
def apply() = NANOSECONDS.toMillis(System.nanoTime)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import akka.actor.ActorInitializationException
|
|||
import akka.annotation.InternalStableApi
|
||||
import akka.util.ccompat._
|
||||
import com.github.ghik.silencer.silent
|
||||
import akka.dispatch.MessageDispatcher
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -149,7 +150,7 @@ private[remote] class Remoting(_system: ExtendedActorSystem, _provider: RemoteAc
|
|||
|
||||
import provider.remoteSettings._
|
||||
|
||||
private implicit val ec = system.dispatchers.lookup(Dispatcher)
|
||||
private implicit val ec: MessageDispatcher = system.dispatchers.lookup(Dispatcher)
|
||||
|
||||
val transportSupervisor = system.systemActorOf(configureDispatcher(Props[TransportSupervisor]), "transports")
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ object ActorTransportAdapter {
|
|||
extends TransportOperation
|
||||
with DeadLetterSuppression
|
||||
|
||||
implicit val AskTimeout = Timeout(5.seconds)
|
||||
implicit val AskTimeout: Timeout = Timeout(5.seconds)
|
||||
}
|
||||
|
||||
@deprecated("Classic remoting is deprecated, use Artery", "2.6.0")
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class HandshakeShouldDropCompressionTableSpec
|
|||
with ImplicitSender
|
||||
with BeforeAndAfter {
|
||||
|
||||
implicit val t = Timeout(3.seconds)
|
||||
implicit val t: Timeout = Timeout(3.seconds)
|
||||
var systemB: ActorSystem = null
|
||||
val portB = freePort()
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ object IndirectMaterializerCreation extends ExtensionId[IndirectMaterializerCrea
|
|||
@silent
|
||||
class IndirectMaterializerCreation(ex: ExtendedActorSystem) extends Extension {
|
||||
// extension instantiation blocked on materializer (which has Await.result inside)
|
||||
implicit val mat = ActorMaterializer()(ex)
|
||||
implicit val mat: ActorMaterializer = ActorMaterializer()(ex)
|
||||
|
||||
def futureThing(n: Int): Future[Int] = {
|
||||
Source.single(n).runWith(Sink.head)
|
||||
|
|
@ -160,7 +160,7 @@ object ActorMaterializerSpec {
|
|||
class ActorWithMaterializer(p: TestProbe) extends Actor {
|
||||
private val settings: ActorMaterializerSettings =
|
||||
ActorMaterializerSettings(context.system).withDispatcher("akka.test.stream-dispatcher")
|
||||
implicit val mat = ActorMaterializer(settings)(context)
|
||||
implicit val mat: ActorMaterializer = ActorMaterializer(settings)(context)
|
||||
|
||||
Source
|
||||
.repeat("hello")
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import scala.util.Success
|
|||
class FileSinkSpec extends StreamSpec(UnboundedMailboxConfig) with ScalaFutures {
|
||||
|
||||
val settings = ActorMaterializerSettings(system).withDispatcher("akka.actor.default-dispatcher")
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
val fs = Jimfs.newFileSystem("FileSinkSpec", Configuration.unix())
|
||||
|
||||
val TestLines = {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ object FileSourceSpec {
|
|||
class FileSourceSpec extends StreamSpec(UnboundedMailboxConfig) {
|
||||
|
||||
val settings = ActorMaterializerSettings(system).withDispatcher("akka.actor.default-dispatcher")
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
val fs = Jimfs.newFileSystem("FileSourceSpec", Configuration.unix())
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import com.github.ghik.silencer.silent
|
|||
class InputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) {
|
||||
|
||||
val settings = ActorMaterializerSettings(system).withDispatcher("akka.actor.default-dispatcher")
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
private def inputStreamFor(bytes: Array[Byte]): InputStream =
|
||||
new ByteArrayInputStream(bytes)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import scala.util.Success
|
|||
class OutputStreamSinkSpec extends StreamSpec(UnboundedMailboxConfig) with ScalaFutures {
|
||||
|
||||
val settings = ActorMaterializerSettings(system).withDispatcher("akka.actor.default-dispatcher")
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
"OutputStreamSink" must {
|
||||
"write bytes to void OutputStream" in assertAllStagesStopped {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscin
|
|||
"\r\n",
|
||||
"\n")
|
||||
|
||||
implicit val system = ActorSystem(getClass.getSimpleName)
|
||||
implicit val system: ActorSystem = ActorSystem(getClass.getSimpleName)
|
||||
|
||||
override def afterAll() = TestKit.shutdownActorSystem(system)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class AttributesSpec
|
|||
|
||||
val settings = ActorMaterializerSettings(system).withInputBuffer(initialSize = 2, maxSize = 16)
|
||||
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
"an attributes instance" must {
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ import scala.concurrent.duration._
|
|||
import scala.concurrent.Await
|
||||
import scala.concurrent.Future
|
||||
import scala.util.control.NoStackTrace
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class FlowFoldAsyncSpec extends StreamSpec {
|
||||
|
||||
implicit def ec = system.dispatcher
|
||||
implicit def ec: ExecutionContextExecutor = system.dispatcher
|
||||
val timeout = Timeout(3.seconds)
|
||||
|
||||
"A FoldAsync" must {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class FlowJoinSpec extends StreamSpec("""
|
|||
akka.stream.materializer.initial-input-buffer-size = 2
|
||||
""") {
|
||||
|
||||
implicit val defaultPatience =
|
||||
implicit val defaultPatience: PatienceConfig =
|
||||
PatienceConfig(timeout = Span(2, Seconds), interval = Span(200, Millis))
|
||||
|
||||
"A Flow using join" must {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class FlowRecoverWithSpec extends StreamSpec {
|
|||
|
||||
val settings = ActorMaterializerSettings(system).withInputBuffer(initialSize = 1, maxSize = 1)
|
||||
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
val ex = new RuntimeException("ex") with NoStackTrace
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ import scala.concurrent.Future
|
|||
import scala.concurrent.Promise
|
||||
import scala.util.Failure
|
||||
import org.scalatest.matchers.should.Matchers
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class FlowScanAsyncSpec extends StreamSpec with Matchers {
|
||||
|
||||
implicit val executionContext = system.dispatcher
|
||||
implicit val executionContext: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
"A ScanAsync" must {
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class FlowSlidingSpec extends StreamSpec with ScalaCheckPropertyChecks {
|
|||
import system.dispatcher
|
||||
val settings = ActorMaterializerSettings(system).withInputBuffer(initialSize = 2, maxSize = 16)
|
||||
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
"Sliding" must {
|
||||
import org.scalacheck.Shrink.shrinkAny
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class FlowSpec extends StreamSpec(ConfigFactory.parseString("akka.actor.debug.re
|
|||
|
||||
val settings = ActorMaterializerSettings(system).withInputBuffer(initialSize = 2, maxSize = 2)
|
||||
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
val identity: Flow[Any, Any, NotUsed] => Flow[Any, Any, NotUsed] = in => in.map(e => e)
|
||||
val identity2: Flow[Any, Any, NotUsed] => Flow[Any, Any, NotUsed] = in => identity(in)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class GraphFlowSpec extends StreamSpec {
|
|||
|
||||
val settings = ActorMaterializerSettings(system).withInputBuffer(initialSize = 2, maxSize = 16)
|
||||
|
||||
implicit val materializer = ActorMaterializer(settings)
|
||||
implicit val materializer: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
def validateProbe(probe: TestSubscriber.ManualProbe[Int], requests: Int, result: Set[Int]): Unit = {
|
||||
val subscription = probe.expectSubscription()
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ class GraphMergeSortedSpec extends TwoStreamsSetup with ScalaCheckPropertyChecks
|
|||
override def out: Outlet[Outputs] = merge.out
|
||||
}
|
||||
|
||||
implicit def noShrink[T] = Shrink[T](_ => Stream.empty) // do not shrink failures, it only destroys evidence
|
||||
implicit def noShrink[T]: Shrink[T] =
|
||||
Shrink[T](_ => Stream.empty) // do not shrink failures, it only destroys evidence
|
||||
|
||||
"MergeSorted" must {
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,11 @@ import akka.stream.testkit.scaladsl.StreamTestKit._
|
|||
import scala.concurrent.duration._
|
||||
import scala.concurrent.Await
|
||||
import scala.concurrent.Future
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class LastSinkSpec extends StreamSpec with ScriptedTest {
|
||||
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
"A Flow with Sink.last" must {
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@ import scala.concurrent.Await
|
|||
import scala.concurrent.Promise
|
||||
import scala.concurrent.duration._
|
||||
import scala.util.control.NoStackTrace
|
||||
import scala.concurrent.ExecutionContextExecutor
|
||||
|
||||
class QueueSinkSpec extends StreamSpec {
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
val ex = new RuntimeException("ex") with NoStackTrace
|
||||
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ import scala.concurrent._
|
|||
import scala.concurrent.duration._
|
||||
|
||||
class QueueSourceSpec extends StreamSpec {
|
||||
implicit val ec = system.dispatcher
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
val pause = 300.millis
|
||||
|
||||
// more frequent checks than defaults from AkkaSpec
|
||||
implicit val testPatience =
|
||||
implicit val testPatience: PatienceConfig =
|
||||
PatienceConfig(testKitSettings.DefaultTimeout.duration, Span(5, org.scalatest.time.Millis))
|
||||
|
||||
def assertSuccess(f: Future[QueueOfferResult]): Unit = {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import scala.collection.immutable
|
|||
@silent // tests assigning to typed val
|
||||
class SourceSpec extends StreamSpec with DefaultTimeout {
|
||||
|
||||
implicit val config = PatienceConfig(timeout = Span(timeout.duration.toMillis, Millis))
|
||||
implicit val config: PatienceConfig = PatienceConfig(timeout = Span(timeout.duration.toMillis, Millis))
|
||||
|
||||
"Single Source" must {
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import scala.concurrent.duration._
|
|||
|
||||
class StreamConvertersSpec extends StreamSpec with DefaultTimeout {
|
||||
|
||||
implicit val config = PatienceConfig(timeout = Span(timeout.duration.toMillis, Millis))
|
||||
implicit val config: PatienceConfig = PatienceConfig(timeout = Span(timeout.duration.toMillis, Millis))
|
||||
|
||||
"Java Stream source" must {
|
||||
import java.util.stream.IntStream
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class TakeLastSinkSpec extends StreamSpec {
|
|||
|
||||
val settings = ActorMaterializerSettings(system).withInputBuffer(initialSize = 2, maxSize = 16)
|
||||
|
||||
implicit val mat = ActorMaterializer(settings)
|
||||
implicit val mat: ActorMaterializer = ActorMaterializer(settings)
|
||||
|
||||
"Sink.takeLast" must {
|
||||
"return the last 3 elements" in {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue