replace unicode arrows again (#26732)
This commit is contained in:
parent
ee67c113e5
commit
a5e9741d35
40 changed files with 125 additions and 125 deletions
|
|
@ -92,7 +92,7 @@ class LogMessagesSpec extends ScalaTestWithActorTestKit("""
|
||||||
logEvent.message should ===("received message Hello")
|
logEvent.message should ===("received message Hello")
|
||||||
logEvent.mdc should ===(Map("mdc" -> true))
|
logEvent.mdc should ===(Map("mdc" -> true))
|
||||||
true
|
true
|
||||||
case _ ⇒
|
case _ =>
|
||||||
false
|
false
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with
|
||||||
case class Probe(message: String, replyTo: ActorRef[String])
|
case class Probe(message: String, replyTo: ActorRef[String])
|
||||||
|
|
||||||
def withSystem[T](name: String, behavior: Behavior[T], doTerminate: Boolean = true)(
|
def withSystem[T](name: String, behavior: Behavior[T], doTerminate: Boolean = true)(
|
||||||
block: ActorSystem[T] ⇒ Unit): Unit = {
|
block: ActorSystem[T] => Unit): Unit = {
|
||||||
val sys = system(behavior, s"$suite-$name")
|
val sys = system(behavior, s"$suite-$name")
|
||||||
try {
|
try {
|
||||||
block(sys)
|
block(sys)
|
||||||
|
|
@ -47,7 +47,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with
|
||||||
withSystem("a", Behaviors.receiveMessage[Probe] { p =>
|
withSystem("a", Behaviors.receiveMessage[Probe] { p =>
|
||||||
p.replyTo ! p.message
|
p.replyTo ! p.message
|
||||||
Behaviors.stopped
|
Behaviors.stopped
|
||||||
}, doTerminate = false) { sys ⇒
|
}, doTerminate = false) { sys =>
|
||||||
val inbox = TestInbox[String]("a")
|
val inbox = TestInbox[String]("a")
|
||||||
sys ! Probe("hello", inbox.ref)
|
sys ! Probe("hello", inbox.ref)
|
||||||
eventually {
|
eventually {
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ class IntroSpec extends ScalaTestWithActorTestKit with WordSpecLike {
|
||||||
import ChatRoom._
|
import ChatRoom._
|
||||||
|
|
||||||
val gabbler: Behavior[SessionEvent] =
|
val gabbler: Behavior[SessionEvent] =
|
||||||
Behaviors.setup { context ⇒
|
Behaviors.setup { context =>
|
||||||
Behaviors.receiveMessage {
|
Behaviors.receiveMessage {
|
||||||
//#chatroom-gabbler
|
//#chatroom-gabbler
|
||||||
// We document that the compiler warns about the missing handler for `SessionDenied`
|
// We document that the compiler warns about the missing handler for `SessionDenied`
|
||||||
|
|
|
||||||
|
|
@ -93,12 +93,12 @@ class OOIntroSpec extends ScalaTestWithActorTestKit with WordSpecLike {
|
||||||
import ChatRoom._
|
import ChatRoom._
|
||||||
|
|
||||||
val gabbler =
|
val gabbler =
|
||||||
Behaviors.setup[SessionEvent] { context ⇒
|
Behaviors.setup[SessionEvent] { context =>
|
||||||
Behaviors.receiveMessage[SessionEvent] {
|
Behaviors.receiveMessage[SessionEvent] {
|
||||||
case SessionDenied(reason) =>
|
case SessionDenied(reason) =>
|
||||||
context.log.info("cannot start chat room session: {}", reason)
|
context.log.info("cannot start chat room session: {}", reason)
|
||||||
Behaviors.stopped
|
Behaviors.stopped
|
||||||
case SessionGranted(handle) ⇒
|
case SessionGranted(handle) =>
|
||||||
handle ! PostMessage("Hello World!")
|
handle ! PostMessage("Hello World!")
|
||||||
Behaviors.same
|
Behaviors.same
|
||||||
case MessagePosted(screenName, message) =>
|
case MessagePosted(screenName, message) =>
|
||||||
|
|
@ -117,7 +117,7 @@ class OOIntroSpec extends ScalaTestWithActorTestKit with WordSpecLike {
|
||||||
|
|
||||||
Behaviors
|
Behaviors
|
||||||
.receiveMessagePartial[String] {
|
.receiveMessagePartial[String] {
|
||||||
case "go" ⇒
|
case "go" =>
|
||||||
chatRoom ! GetSession("ol’ Gabbler", gabblerRef)
|
chatRoom ! GetSession("ol’ Gabbler", gabblerRef)
|
||||||
Behaviors.same
|
Behaviors.same
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ private[akka] trait DeathWatch { this: ActorCell =>
|
||||||
}
|
}
|
||||||
|
|
||||||
protected def receivedTerminated(t: Terminated): Unit =
|
protected def receivedTerminated(t: Terminated): Unit =
|
||||||
terminatedQueued.get(t.actor).foreach { optionalMessage ⇒
|
terminatedQueued.get(t.actor).foreach { optionalMessage =>
|
||||||
terminatedQueued -= t.actor // here we know that it is the SAME ref which was put in
|
terminatedQueued -= t.actor // here we know that it is the SAME ref which was put in
|
||||||
receiveMessage(optionalMessage.getOrElse(t))
|
receiveMessage(optionalMessage.getOrElse(t))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,22 +121,22 @@ object ClusterShardingPersistenceSpec {
|
||||||
stashing = false
|
stashing = false
|
||||||
Effect.unstashAll()
|
Effect.unstashAll()
|
||||||
|
|
||||||
case UnstashAllAndPassivate ⇒
|
case UnstashAllAndPassivate =>
|
||||||
stashing = false
|
stashing = false
|
||||||
shard ! Passivate(ctx.self)
|
shard ! Passivate(ctx.self)
|
||||||
Effect.unstashAll()
|
Effect.unstashAll()
|
||||||
},
|
},
|
||||||
eventHandler = (state, evt) ⇒ if (state.isEmpty) evt else state + "|" + evt).receiveSignal {
|
eventHandler = (state, evt) => if (state.isEmpty) evt else state + "|" + evt).receiveSignal {
|
||||||
case (state, RecoveryCompleted) ⇒
|
case (state, RecoveryCompleted) =>
|
||||||
ctx.log.debug("onRecoveryCompleted: [{}]", state)
|
ctx.log.debug("onRecoveryCompleted: [{}]", state)
|
||||||
lifecycleProbes.get(entityId) match {
|
lifecycleProbes.get(entityId) match {
|
||||||
case null ⇒ ctx.log.debug("no lifecycleProbe (onRecoveryCompleted) for [{}]", entityId)
|
case null => ctx.log.debug("no lifecycleProbe (onRecoveryCompleted) for [{}]", entityId)
|
||||||
case p ⇒ p ! s"recoveryCompleted:$state"
|
case p => p ! s"recoveryCompleted:$state"
|
||||||
}
|
}
|
||||||
case (_, PostStop) ⇒
|
case (_, PostStop) =>
|
||||||
lifecycleProbes.get(entityId) match {
|
lifecycleProbes.get(entityId) match {
|
||||||
case null ⇒ ctx.log.debug("no lifecycleProbe (postStop) for [{}]", entityId)
|
case null => ctx.log.debug("no lifecycleProbe (postStop) for [{}]", entityId)
|
||||||
case p ⇒ p ! "stopped"
|
case p => p ! "stopped"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ object ClusterShardingSettings {
|
||||||
else config.getDuration("passivate-idle-entity-after", MILLISECONDS).millis
|
else config.getDuration("passivate-idle-entity-after", MILLISECONDS).millis
|
||||||
|
|
||||||
val lease = config.getString("use-lease") match {
|
val lease = config.getString("use-lease") match {
|
||||||
case s if s.isEmpty ⇒ None
|
case s if s.isEmpty => None
|
||||||
case other ⇒ Some(new LeaseUsageSettings(other, config.getDuration("lease-retry-interval").asScala))
|
case other => Some(new LeaseUsageSettings(other, config.getDuration("lease-retry-interval").asScala))
|
||||||
}
|
}
|
||||||
|
|
||||||
new ClusterShardingSettings(
|
new ClusterShardingSettings(
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ object ShardSpec {
|
||||||
|
|
||||||
class EntityActor extends Actor with ActorLogging {
|
class EntityActor extends Actor with ActorLogging {
|
||||||
override def receive: Receive = {
|
override def receive: Receive = {
|
||||||
case msg ⇒
|
case msg =>
|
||||||
log.info("Msg {}", msg)
|
log.info("Msg {}", msg)
|
||||||
sender() ! s"ack ${msg}"
|
sender() ! s"ack ${msg}"
|
||||||
}
|
}
|
||||||
|
|
@ -45,11 +45,11 @@ object ShardSpec {
|
||||||
case class EntityEnvelope(entityId: Int, msg: Any)
|
case class EntityEnvelope(entityId: Int, msg: Any)
|
||||||
|
|
||||||
val extractEntityId: ShardRegion.ExtractEntityId = {
|
val extractEntityId: ShardRegion.ExtractEntityId = {
|
||||||
case EntityEnvelope(id, payload) ⇒ (id.toString, payload)
|
case EntityEnvelope(id, payload) => (id.toString, payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
val extractShardId: ShardRegion.ExtractShardId = {
|
val extractShardId: ShardRegion.ExtractShardId = {
|
||||||
case EntityEnvelope(id, _) ⇒ (id % numberOfShards).toString
|
case EntityEnvelope(id, _) => (id % numberOfShards).toString
|
||||||
}
|
}
|
||||||
|
|
||||||
case class BadLease(msg: String) extends RuntimeException(msg) with NoStackTrace
|
case class BadLease(msg: String) extends RuntimeException(msg) with NoStackTrace
|
||||||
|
|
@ -111,7 +111,7 @@ class ShardSpec extends AkkaSpec(ShardSpec.config) with ImplicitSender {
|
||||||
Shard.props(
|
Shard.props(
|
||||||
typeName,
|
typeName,
|
||||||
shardId,
|
shardId,
|
||||||
_ ⇒ Props(new EntityActor()),
|
_ => Props(new EntityActor()),
|
||||||
settings,
|
settings,
|
||||||
extractEntityId,
|
extractEntityId,
|
||||||
extractShardId,
|
extractShardId,
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ object ClusterSingletonManagerSettings {
|
||||||
*/
|
*/
|
||||||
def apply(config: Config): ClusterSingletonManagerSettings = {
|
def apply(config: Config): ClusterSingletonManagerSettings = {
|
||||||
val lease = config.getString("use-lease") match {
|
val lease = config.getString("use-lease") match {
|
||||||
case s if s.isEmpty ⇒ None
|
case s if s.isEmpty => None
|
||||||
case leaseConfigPath =>
|
case leaseConfigPath =>
|
||||||
Some(new LeaseUsageSettings(leaseConfigPath, config.getDuration("lease-retry-interval").asScala))
|
Some(new LeaseUsageSettings(leaseConfigPath, config.getDuration("lease-retry-interval").asScala))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,23 +45,23 @@ class TestLeaseActor extends Actor with ActorLogging {
|
||||||
|
|
||||||
override def receive = {
|
override def receive = {
|
||||||
|
|
||||||
case c: Create ⇒
|
case c: Create =>
|
||||||
log.info("Lease created with name {} ownerName {}", c.leaseName, c.ownerName)
|
log.info("Lease created with name {} ownerName {}", c.leaseName, c.ownerName)
|
||||||
|
|
||||||
case request: LeaseRequest ⇒
|
case request: LeaseRequest =>
|
||||||
log.info("Lease request {} from {}", request, sender())
|
log.info("Lease request {} from {}", request, sender())
|
||||||
requests = (sender(), request) :: requests
|
requests = (sender(), request) :: requests
|
||||||
|
|
||||||
case GetRequests ⇒
|
case GetRequests =>
|
||||||
sender() ! LeaseRequests(requests.map(_._2))
|
sender() ! LeaseRequests(requests.map(_._2))
|
||||||
|
|
||||||
case ActionRequest(request, result) ⇒
|
case ActionRequest(request, result) =>
|
||||||
requests.find(_._2 == request) match {
|
requests.find(_._2 == request) match {
|
||||||
case Some((snd, req)) ⇒
|
case Some((snd, req)) =>
|
||||||
log.info("Actioning request {} to {}", req, result)
|
log.info("Actioning request {} to {}", req, result)
|
||||||
snd ! result
|
snd ! result
|
||||||
requests = requests.filterNot(_._2 == request)
|
requests = requests.filterNot(_._2 == request)
|
||||||
case None ⇒
|
case None =>
|
||||||
throw new RuntimeException(s"unknown request to action: ${request}. Requests: ${requests}")
|
throw new RuntimeException(s"unknown request to action: ${request}. Requests: ${requests}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,6 +111,6 @@ class TestLeaseActorClient(settings: LeaseSettings, system: ExtendedActorSystem)
|
||||||
|
|
||||||
override def checkLease(): Boolean = false
|
override def checkLease(): Boolean = false
|
||||||
|
|
||||||
override def acquire(callback: Option[Throwable] ⇒ Unit): Future[Boolean] =
|
override def acquire(callback: Option[Throwable] => Unit): Future[Boolean] =
|
||||||
(leaseActor ? Acquire(settings.ownerName)).mapTo[Boolean]
|
(leaseActor ? Acquire(settings.ownerName)).mapTo[Boolean]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ object ClusterSingletonManagerLeaseSpec extends MultiNodeConfig {
|
||||||
log.info("Singleton stopping")
|
log.info("Singleton stopping")
|
||||||
}
|
}
|
||||||
override def receive: Receive = {
|
override def receive: Receive = {
|
||||||
case msg ⇒
|
case msg =>
|
||||||
sender() ! Response(msg, selfAddress)
|
sender() ! Response(msg, selfAddress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ class TestLease(settings: LeaseSettings, system: ExtendedActorSystem) extends Le
|
||||||
|
|
||||||
private val nextAcquireResult = new AtomicReference[Future[Boolean]](initialPromise.future)
|
private val nextAcquireResult = new AtomicReference[Future[Boolean]](initialPromise.future)
|
||||||
private val nextCheckLeaseResult = new AtomicReference[Boolean](false)
|
private val nextCheckLeaseResult = new AtomicReference[Boolean](false)
|
||||||
private val currentCallBack = new AtomicReference[Option[Throwable] ⇒ Unit](_ ⇒ ())
|
private val currentCallBack = new AtomicReference[Option[Throwable] => Unit](_ => ())
|
||||||
|
|
||||||
def setNextAcquireResult(next: Future[Boolean]): Unit =
|
def setNextAcquireResult(next: Future[Boolean]): Unit =
|
||||||
nextAcquireResult.set(next)
|
nextAcquireResult.set(next)
|
||||||
|
|
@ -73,7 +73,7 @@ class TestLease(settings: LeaseSettings, system: ExtendedActorSystem) extends Le
|
||||||
def setNextCheckLeaseResult(value: Boolean): Unit =
|
def setNextCheckLeaseResult(value: Boolean): Unit =
|
||||||
nextCheckLeaseResult.set(value)
|
nextCheckLeaseResult.set(value)
|
||||||
|
|
||||||
def getCurrentCallback(): Option[Throwable] ⇒ Unit = currentCallBack.get()
|
def getCurrentCallback(): Option[Throwable] => Unit = currentCallBack.get()
|
||||||
|
|
||||||
override def acquire(): Future[Boolean] = {
|
override def acquire(): Future[Boolean] = {
|
||||||
log.info("acquire, current response " + nextAcquireResult)
|
log.info("acquire, current response " + nextAcquireResult)
|
||||||
|
|
@ -88,7 +88,7 @@ class TestLease(settings: LeaseSettings, system: ExtendedActorSystem) extends Le
|
||||||
|
|
||||||
override def checkLease(): Boolean = nextCheckLeaseResult.get
|
override def checkLease(): Boolean = nextCheckLeaseResult.get
|
||||||
|
|
||||||
override def acquire(callback: Option[Throwable] ⇒ Unit): Future[Boolean] = {
|
override def acquire(callback: Option[Throwable] => Unit): Future[Boolean] = {
|
||||||
currentCallBack.set(callback)
|
currentCallBack.set(callback)
|
||||||
acquire()
|
acquire()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class ImportantSingleton(lifeCycleProbe: ActorRef) extends Actor with ActorLoggi
|
||||||
}
|
}
|
||||||
|
|
||||||
override def receive: Receive = {
|
override def receive: Receive = {
|
||||||
case msg ⇒
|
case msg =>
|
||||||
sender() ! msg
|
sender() ! msg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class ActorSystemSpec extends WordSpec with Matchers with BeforeAndAfterAll with
|
||||||
withSystem("a", Behaviors.receiveMessage[Probe] { p =>
|
withSystem("a", Behaviors.receiveMessage[Probe] { p =>
|
||||||
p.replyTo ! p.message
|
p.replyTo ! p.message
|
||||||
Behaviors.stopped
|
Behaviors.stopped
|
||||||
}, doTerminate = false) { sys ⇒
|
}, doTerminate = false) { sys =>
|
||||||
val inbox = TestInbox[String]("a")
|
val inbox = TestInbox[String]("a")
|
||||||
sys ! Probe("hello", inbox.ref)
|
sys ! Probe("hello", inbox.ref)
|
||||||
eventually {
|
eventually {
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ object TimeoutSettings {
|
||||||
def apply(config: Config): TimeoutSettings = {
|
def apply(config: Config): TimeoutSettings = {
|
||||||
val heartBeatTimeout = config.getDuration("heartbeat-timeout").asScala
|
val heartBeatTimeout = config.getDuration("heartbeat-timeout").asScala
|
||||||
val heartBeatInterval = config.getValue("heartbeat-interval").valueType() match {
|
val heartBeatInterval = config.getValue("heartbeat-interval").valueType() match {
|
||||||
case ConfigValueType.STRING if config.getString("heartbeat-interval").isEmpty ⇒
|
case ConfigValueType.STRING if config.getString("heartbeat-interval").isEmpty =>
|
||||||
(heartBeatTimeout / 10).max(5.seconds)
|
(heartBeatTimeout / 10).max(5.seconds)
|
||||||
case _ ⇒ config.getDuration("heartbeat-interval").asScala
|
case _ => config.getDuration("heartbeat-interval").asScala
|
||||||
}
|
}
|
||||||
require(heartBeatInterval < (heartBeatTimeout / 2), "heartbeat-interval must be less than half heartbeat-timeout")
|
require(heartBeatInterval < (heartBeatTimeout / 2), "heartbeat-interval must be less than half heartbeat-timeout")
|
||||||
new TimeoutSettings(heartBeatInterval, heartBeatTimeout, config.getDuration("lease-operation-timeout").asScala)
|
new TimeoutSettings(heartBeatInterval, heartBeatTimeout, config.getDuration("lease-operation-timeout").asScala)
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ final private[akka] class LeaseAdapter(delegate: ScalaLease)(implicit val ec: Ex
|
||||||
override def acquire(): CompletionStage[java.lang.Boolean] = delegate.acquire().map(Boolean.box).toJava
|
override def acquire(): CompletionStage[java.lang.Boolean] = delegate.acquire().map(Boolean.box).toJava
|
||||||
|
|
||||||
override def acquire(leaseLostCallback: Consumer[Optional[Throwable]]): CompletionStage[java.lang.Boolean] = {
|
override def acquire(leaseLostCallback: Consumer[Optional[Throwable]]): CompletionStage[java.lang.Boolean] = {
|
||||||
delegate.acquire(o ⇒ leaseLostCallback.accept(o.asJava)).map(Boolean.box).toJava
|
delegate.acquire(o => leaseLostCallback.accept(o.asJava)).map(Boolean.box).toJava
|
||||||
}
|
}
|
||||||
|
|
||||||
override def release(): CompletionStage[java.lang.Boolean] = delegate.release().map(Boolean.box).toJava
|
override def release(): CompletionStage[java.lang.Boolean] = delegate.release().map(Boolean.box).toJava
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ package akka.coordination.lease.javadsl
|
||||||
import akka.actor.{ ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider }
|
import akka.actor.{ ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider }
|
||||||
import akka.annotation.ApiMayChange
|
import akka.annotation.ApiMayChange
|
||||||
import akka.coordination.lease.internal.LeaseAdapter
|
import akka.coordination.lease.internal.LeaseAdapter
|
||||||
import akka.coordination.lease.scaladsl.{ LeaseProvider ⇒ ScalaLeaseProvider }
|
import akka.coordination.lease.scaladsl.{ LeaseProvider => ScalaLeaseProvider }
|
||||||
|
|
||||||
@ApiMayChange
|
@ApiMayChange
|
||||||
object LeaseProvider extends ExtensionId[LeaseProvider] with ExtensionIdProvider {
|
object LeaseProvider extends ExtensionId[LeaseProvider] with ExtensionIdProvider {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ abstract class Lease(val settings: LeaseSettings) {
|
||||||
* Implementations should not call leaseLostCallback until after the returned future
|
* Implementations should not call leaseLostCallback until after the returned future
|
||||||
* has been completed
|
* has been completed
|
||||||
*/
|
*/
|
||||||
def acquire(leaseLostCallback: Option[Throwable] ⇒ Unit): Future[Boolean]
|
def acquire(leaseLostCallback: Option[Throwable] => Unit): Future[Boolean]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Release the lease so some other owner can acquire it.
|
* Release the lease so some other owner can acquire it.
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,8 @@ class LeaseProvider(system: ExtendedActorSystem) extends Extension {
|
||||||
f
|
f
|
||||||
}
|
}
|
||||||
instance match {
|
instance match {
|
||||||
case Success(value) ⇒ value
|
case Success(value) => value
|
||||||
case Failure(e) ⇒
|
case Failure(e) =>
|
||||||
log.error(
|
log.error(
|
||||||
e,
|
e,
|
||||||
"Invalid lease configuration for leaseName [{}], configPath [{}] lease-class [{}]. " +
|
"Invalid lease configuration for leaseName [{}], configPath [{}] lease-class [{}]. " +
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ object LeaseProviderSpec {
|
||||||
override def acquire(): Future[Boolean] = Future.successful(false)
|
override def acquire(): Future[Boolean] = Future.successful(false)
|
||||||
override def release(): Future[Boolean] = Future.successful(false)
|
override def release(): Future[Boolean] = Future.successful(false)
|
||||||
override def checkLease(): Boolean = false
|
override def checkLease(): Boolean = false
|
||||||
override def acquire(callback: Option[Throwable] ⇒ Unit): Future[Boolean] = Future.successful(false)
|
override def acquire(callback: Option[Throwable] => Unit): Future[Boolean] = Future.successful(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
class LeaseB(settings: LeaseSettings, system: ExtendedActorSystem) extends Lease(settings) {
|
class LeaseB(settings: LeaseSettings, system: ExtendedActorSystem) extends Lease(settings) {
|
||||||
|
|
@ -25,7 +25,7 @@ object LeaseProviderSpec {
|
||||||
override def acquire(): Future[Boolean] = Future.successful(false)
|
override def acquire(): Future[Boolean] = Future.successful(false)
|
||||||
override def release(): Future[Boolean] = Future.successful(false)
|
override def release(): Future[Boolean] = Future.successful(false)
|
||||||
override def checkLease(): Boolean = false
|
override def checkLease(): Boolean = false
|
||||||
override def acquire(callback: Option[Throwable] ⇒ Unit): Future[Boolean] = Future.successful(false)
|
override def acquire(callback: Option[Throwable] => Unit): Future[Boolean] = Future.successful(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
val config = ConfigFactory.parseString(s"""
|
val config = ConfigFactory.parseString(s"""
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ object Discovery extends ExtensionId[Discovery] with ExtensionIdProvider {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Old version of Akka Discovery from Akka Management found on the classpath. Remove `com.lightbend.akka.discovery:akka-discovery` from the classpath..")
|
"Old version of Akka Discovery from Akka Management found on the classpath. Remove `com.lightbend.akka.discovery:akka-discovery` from the classpath..")
|
||||||
} catch {
|
} catch {
|
||||||
case _: ClassCastException ⇒
|
case _: ClassCastException =>
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Old version of Akka Discovery from Akka Management found on the classpath. Remove `com.lightbend.akka.discovery:akka-discovery` from the classpath..")
|
"Old version of Akka Discovery from Akka Management found on the classpath. Remove `com.lightbend.akka.discovery:akka-discovery` from the classpath..")
|
||||||
case _: ClassNotFoundException =>
|
case _: ClassNotFoundException =>
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class LookupSpec extends WordSpec with Matchers with OptionValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
"generate a SRV Lookup from a valid SRV String" in {
|
"generate a SRV Lookup from a valid SRV String" in {
|
||||||
srvWithValidDomainNames.foreach { str ⇒
|
srvWithValidDomainNames.foreach { str =>
|
||||||
withClue(s"parsing '$str'") {
|
withClue(s"parsing '$str'") {
|
||||||
val lookup = Lookup.parseSrv(str)
|
val lookup = Lookup.parseSrv(str)
|
||||||
lookup.portName.value shouldBe "portName"
|
lookup.portName.value shouldBe "portName"
|
||||||
|
|
@ -117,7 +117,7 @@ class LookupSpec extends WordSpec with Matchers with OptionValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
"return true for any valid SRV String" in {
|
"return true for any valid SRV String" in {
|
||||||
srvWithValidDomainNames.foreach { str ⇒
|
srvWithValidDomainNames.foreach { str =>
|
||||||
withClue(s"parsing '$str'") {
|
withClue(s"parsing '$str'") {
|
||||||
Lookup.isValidSrv(str) shouldBe true
|
Lookup.isValidSrv(str) shouldBe true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class DeltaPropagationSelectorSpec extends WordSpec with Matchers with TypeCheck
|
||||||
DeltaPropagation(
|
DeltaPropagation(
|
||||||
selfUniqueAddress,
|
selfUniqueAddress,
|
||||||
false,
|
false,
|
||||||
Map("A" -> Delta(DataEnvelope(deltaA), 1L, 1L), "B" → Delta(DataEnvelope(deltaB), 1L, 1L)))
|
Map("A" -> Delta(DataEnvelope(deltaA), 1L, 1L), "B" -> Delta(DataEnvelope(deltaB), 1L, 1L)))
|
||||||
selector.collectPropagations() should ===(Map(nodes(0) -> expected))
|
selector.collectPropagations() should ===(Map(nodes(0) -> expected))
|
||||||
selector.collectPropagations() should ===(Map.empty[UniqueAddress, DeltaPropagation])
|
selector.collectPropagations() should ===(Map.empty[UniqueAddress, DeltaPropagation])
|
||||||
selector.cleanupDeltaEntries()
|
selector.cleanupDeltaEntries()
|
||||||
|
|
@ -72,8 +72,8 @@ class DeltaPropagationSelectorSpec extends WordSpec with Matchers with TypeCheck
|
||||||
DeltaPropagation(
|
DeltaPropagation(
|
||||||
selfUniqueAddress,
|
selfUniqueAddress,
|
||||||
false,
|
false,
|
||||||
Map("A" -> Delta(DataEnvelope(deltaA), 1L, 1L), "B" → Delta(DataEnvelope(deltaB), 1L, 1L)))
|
Map("A" -> Delta(DataEnvelope(deltaA), 1L, 1L), "B" -> Delta(DataEnvelope(deltaB), 1L, 1L)))
|
||||||
selector.collectPropagations() should ===(Map(nodes(0) -> expected, nodes(1) → expected))
|
selector.collectPropagations() should ===(Map(nodes(0) -> expected, nodes(1) -> expected))
|
||||||
selector.cleanupDeltaEntries()
|
selector.cleanupDeltaEntries()
|
||||||
selector.hasDeltaEntries("A") should ===(true)
|
selector.hasDeltaEntries("A") should ===(true)
|
||||||
selector.hasDeltaEntries("B") should ===(true)
|
selector.hasDeltaEntries("B") should ===(true)
|
||||||
|
|
@ -92,8 +92,8 @@ class DeltaPropagationSelectorSpec extends WordSpec with Matchers with TypeCheck
|
||||||
DeltaPropagation(
|
DeltaPropagation(
|
||||||
selfUniqueAddress,
|
selfUniqueAddress,
|
||||||
false,
|
false,
|
||||||
Map("A" -> Delta(DataEnvelope(deltaA), 1L, 1L), "B" → Delta(DataEnvelope(deltaB), 1L, 1L)))
|
Map("A" -> Delta(DataEnvelope(deltaA), 1L, 1L), "B" -> Delta(DataEnvelope(deltaB), 1L, 1L)))
|
||||||
selector.collectPropagations() should ===(Map(nodes(0) -> expected1, nodes(1) → expected1))
|
selector.collectPropagations() should ===(Map(nodes(0) -> expected1, nodes(1) -> expected1))
|
||||||
// new update before previous was propagated to all nodes
|
// new update before previous was propagated to all nodes
|
||||||
selector.update("C", deltaC)
|
selector.update("C", deltaC)
|
||||||
val expected2 = DeltaPropagation(
|
val expected2 = DeltaPropagation(
|
||||||
|
|
@ -105,7 +105,7 @@ class DeltaPropagationSelectorSpec extends WordSpec with Matchers with TypeCheck
|
||||||
"C" -> Delta(DataEnvelope(deltaC), 1L, 1L)))
|
"C" -> Delta(DataEnvelope(deltaC), 1L, 1L)))
|
||||||
val expected3 =
|
val expected3 =
|
||||||
DeltaPropagation(selfUniqueAddress, false, Map("C" -> Delta(DataEnvelope(deltaC), 1L, 1L)))
|
DeltaPropagation(selfUniqueAddress, false, Map("C" -> Delta(DataEnvelope(deltaC), 1L, 1L)))
|
||||||
selector.collectPropagations() should ===(Map(nodes(2) -> expected2, nodes(0) → expected3))
|
selector.collectPropagations() should ===(Map(nodes(2) -> expected2, nodes(0) -> expected3))
|
||||||
selector.cleanupDeltaEntries()
|
selector.cleanupDeltaEntries()
|
||||||
selector.hasDeltaEntries("A") should ===(false)
|
selector.hasDeltaEntries("A") should ===(false)
|
||||||
selector.hasDeltaEntries("B") should ===(false)
|
selector.hasDeltaEntries("B") should ===(false)
|
||||||
|
|
|
||||||
|
|
@ -112,27 +112,27 @@ class ReplicatorMessageSerializerSpec
|
||||||
checkSerialization(ReadResult(None))
|
checkSerialization(ReadResult(None))
|
||||||
checkSerialization(
|
checkSerialization(
|
||||||
Status(
|
Status(
|
||||||
Map("A" -> ByteString.fromString("a"), "B" → ByteString.fromString("b")),
|
Map("A" -> ByteString.fromString("a"), "B" -> ByteString.fromString("b")),
|
||||||
chunk = 3,
|
chunk = 3,
|
||||||
totChunks = 10,
|
totChunks = 10,
|
||||||
Some(17),
|
Some(17),
|
||||||
Some(19)))
|
Some(19)))
|
||||||
checkSerialization(
|
checkSerialization(
|
||||||
Status(
|
Status(
|
||||||
Map("A" -> ByteString.fromString("a"), "B" → ByteString.fromString("b")),
|
Map("A" -> ByteString.fromString("a"), "B" -> ByteString.fromString("b")),
|
||||||
chunk = 3,
|
chunk = 3,
|
||||||
totChunks = 10,
|
totChunks = 10,
|
||||||
None, // can be None when sending back to a node of version 2.5.21
|
None, // can be None when sending back to a node of version 2.5.21
|
||||||
Some(19)))
|
Some(19)))
|
||||||
checkSerialization(
|
checkSerialization(
|
||||||
Gossip(
|
Gossip(
|
||||||
Map("A" -> DataEnvelope(data1), "B" → DataEnvelope(GSet() + "b" + "c")),
|
Map("A" -> DataEnvelope(data1), "B" -> DataEnvelope(GSet() + "b" + "c")),
|
||||||
sendBack = true,
|
sendBack = true,
|
||||||
Some(17),
|
Some(17),
|
||||||
Some(19)))
|
Some(19)))
|
||||||
checkSerialization(
|
checkSerialization(
|
||||||
Gossip(
|
Gossip(
|
||||||
Map("A" -> DataEnvelope(data1), "B" → DataEnvelope(GSet() + "b" + "c")),
|
Map("A" -> DataEnvelope(data1), "B" -> DataEnvelope(GSet() + "b" + "c")),
|
||||||
sendBack = true,
|
sendBack = true,
|
||||||
None, // can be None when sending back to a node of version 2.5.21
|
None, // can be None when sending back to a node of version 2.5.21
|
||||||
Some(19)))
|
Some(19)))
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ private[akka] final class BehaviorSetup[C, E, S](
|
||||||
val eventHandler: EventSourcedBehavior.EventHandler[S, E],
|
val eventHandler: EventSourcedBehavior.EventHandler[S, E],
|
||||||
val writerIdentity: EventSourcedBehaviorImpl.WriterIdentity,
|
val writerIdentity: EventSourcedBehaviorImpl.WriterIdentity,
|
||||||
private val signalHandler: PartialFunction[(S, Signal), Unit],
|
private val signalHandler: PartialFunction[(S, Signal), Unit],
|
||||||
val tagger: E ⇒ Set[String],
|
val tagger: E => Set[String],
|
||||||
val eventAdapter: EventAdapter[E, _],
|
val eventAdapter: EventAdapter[E, _],
|
||||||
val snapshotWhen: (S, E, Long) ⇒ Boolean,
|
val snapshotWhen: (S, E, Long) => Boolean,
|
||||||
val recovery: Recovery,
|
val recovery: Recovery,
|
||||||
val retention: RetentionCriteria,
|
val retention: RetentionCriteria,
|
||||||
var holdingRecoveryPermit: Boolean,
|
var holdingRecoveryPermit: Boolean,
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,9 @@ private[akka] final case class EventSourcedBehaviorImpl[Command, Event, State](
|
||||||
loggerClass: Class[_],
|
loggerClass: Class[_],
|
||||||
journalPluginId: Option[String] = None,
|
journalPluginId: Option[String] = None,
|
||||||
snapshotPluginId: Option[String] = None,
|
snapshotPluginId: Option[String] = None,
|
||||||
tagger: Event ⇒ Set[String] = (_: Event) ⇒ Set.empty[String],
|
tagger: Event => Set[String] = (_: Event) => Set.empty[String],
|
||||||
eventAdapter: EventAdapter[Event, Any] = NoOpEventAdapter.instance[Event],
|
eventAdapter: EventAdapter[Event, Any] = NoOpEventAdapter.instance[Event],
|
||||||
snapshotWhen: (State, Event, Long) ⇒ Boolean = ConstantFun.scalaAnyThreeToFalse,
|
snapshotWhen: (State, Event, Long) => Boolean = ConstantFun.scalaAnyThreeToFalse,
|
||||||
recovery: Recovery = Recovery(),
|
recovery: Recovery = Recovery(),
|
||||||
retention: RetentionCriteria = RetentionCriteria.disabled,
|
retention: RetentionCriteria = RetentionCriteria.disabled,
|
||||||
supervisionStrategy: SupervisorStrategy = SupervisorStrategy.stop,
|
supervisionStrategy: SupervisorStrategy = SupervisorStrategy.stop,
|
||||||
|
|
@ -87,9 +87,9 @@ private[akka] final case class EventSourcedBehaviorImpl[Command, Event, State](
|
||||||
|
|
||||||
val actualSignalHandler: PartialFunction[(State, Signal), Unit] = signalHandler.orElse {
|
val actualSignalHandler: PartialFunction[(State, Signal), Unit] = signalHandler.orElse {
|
||||||
// default signal handler is always the fallback
|
// default signal handler is always the fallback
|
||||||
case (_, SnapshotCompleted(meta)) ⇒
|
case (_, SnapshotCompleted(meta)) =>
|
||||||
ctx.log.debug("Save snapshot successful, snapshot metadata [{}].", meta)
|
ctx.log.debug("Save snapshot successful, snapshot metadata [{}].", meta)
|
||||||
case (_, SnapshotFailed(meta, failure)) ⇒
|
case (_, SnapshotFailed(meta, failure)) =>
|
||||||
ctx.log.error(failure, "Save snapshot failed, snapshot metadata [{}].", meta)
|
ctx.log.error(failure, "Save snapshot failed, snapshot metadata [{}].", meta)
|
||||||
case (_, DeleteSnapshotsCompleted(DeletionTarget.Individual(meta))) =>
|
case (_, DeleteSnapshotsCompleted(DeletionTarget.Individual(meta))) =>
|
||||||
ctx.log.debug("Persistent snapshot [{}] deleted successfully.", meta)
|
ctx.log.debug("Persistent snapshot [{}] deleted successfully.", meta)
|
||||||
|
|
@ -107,7 +107,7 @@ private[akka] final case class EventSourcedBehaviorImpl[Command, Event, State](
|
||||||
|
|
||||||
Behaviors
|
Behaviors
|
||||||
.supervise {
|
.supervise {
|
||||||
Behaviors.setup[Command] { _ ⇒
|
Behaviors.setup[Command] { _ =>
|
||||||
val eventSourcedSetup = new BehaviorSetup(
|
val eventSourcedSetup = new BehaviorSetup(
|
||||||
ctx.asInstanceOf[ActorContext[InternalProtocol]],
|
ctx.asInstanceOf[ActorContext[InternalProtocol]],
|
||||||
persistenceId,
|
persistenceId,
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ final class SignalHandlerBuilder[State] {
|
||||||
*/
|
*/
|
||||||
def onSignal[T <: Signal](signalType: Class[T], callback: BiConsumer[State, T]): SignalHandlerBuilder[State] = {
|
def onSignal[T <: Signal](signalType: Class[T], callback: BiConsumer[State, T]): SignalHandlerBuilder[State] = {
|
||||||
val newPF: PartialFunction[(State, Signal), Unit] = {
|
val newPF: PartialFunction[(State, Signal), Unit] = {
|
||||||
case (state, t) if signalType.isInstance(t) ⇒
|
case (state, t) if signalType.isInstance(t) =>
|
||||||
callback.accept(state, t.asInstanceOf[T])
|
callback.accept(state, t.asInstanceOf[T])
|
||||||
}
|
}
|
||||||
handler = newPF.orElse(handler)
|
handler = newPF.orElse(handler)
|
||||||
|
|
@ -61,7 +61,7 @@ final class SignalHandlerBuilder[State] {
|
||||||
*/
|
*/
|
||||||
def onSignal[T <: Signal](signal: T, callback: Consumer[State]): SignalHandlerBuilder[State] = {
|
def onSignal[T <: Signal](signal: T, callback: Consumer[State]): SignalHandlerBuilder[State] = {
|
||||||
val newPF: PartialFunction[(State, Signal), Unit] = {
|
val newPF: PartialFunction[(State, Signal), Unit] = {
|
||||||
case (state, `signal`) ⇒
|
case (state, `signal`) =>
|
||||||
callback.accept(state)
|
callback.accept(state)
|
||||||
}
|
}
|
||||||
handler = newPF.orElse(handler)
|
handler = newPF.orElse(handler)
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ class EventSourcedBehaviorFailureSpec
|
||||||
EventSourcedBehavior[String, String, String](
|
EventSourcedBehavior[String, String, String](
|
||||||
pid,
|
pid,
|
||||||
"",
|
"",
|
||||||
(_, cmd) ⇒ {
|
(_, cmd) => {
|
||||||
if (cmd == "wrong")
|
if (cmd == "wrong")
|
||||||
throw TestException("wrong command")
|
throw TestException("wrong command")
|
||||||
probe.tell("persisting")
|
probe.tell("persisting")
|
||||||
|
|
@ -111,17 +111,17 @@ class EventSourcedBehaviorFailureSpec
|
||||||
if (cmd == "wrong-callback") throw TestException("wrong command")
|
if (cmd == "wrong-callback") throw TestException("wrong command")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(state, event) ⇒ {
|
(state, event) => {
|
||||||
if (event == "wrong-event")
|
if (event == "wrong-event")
|
||||||
throw TestException("wrong event")
|
throw TestException("wrong event")
|
||||||
probe.tell(event)
|
probe.tell(event)
|
||||||
state + event
|
state + event
|
||||||
}).receiveSignal(additionalSignalHandler.orElse {
|
}).receiveSignal(additionalSignalHandler.orElse {
|
||||||
case (_, RecoveryCompleted) ⇒
|
case (_, RecoveryCompleted) =>
|
||||||
probe.tell("starting")
|
probe.tell("starting")
|
||||||
case (_, PostStop) ⇒
|
case (_, PostStop) =>
|
||||||
probe.tell("stopped")
|
probe.tell("stopped")
|
||||||
case (_, PreRestart) ⇒
|
case (_, PreRestart) =>
|
||||||
probe.tell("restarting")
|
probe.tell("restarting")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -132,7 +132,7 @@ class EventSourcedBehaviorFailureSpec
|
||||||
val probe = TestProbe[String]()
|
val probe = TestProbe[String]()
|
||||||
val excProbe = TestProbe[Throwable]()
|
val excProbe = TestProbe[Throwable]()
|
||||||
spawn(failingPersistentActor(PersistenceId("fail-recovery"), probe.ref, {
|
spawn(failingPersistentActor(PersistenceId("fail-recovery"), probe.ref, {
|
||||||
case (_, RecoveryFailed(t)) ⇒
|
case (_, RecoveryFailed(t)) =>
|
||||||
excProbe.ref ! t
|
excProbe.ref ! t
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ class EventSourcedBehaviorFailureSpec
|
||||||
"handle exceptions from RecoveryFailed signal handler" in {
|
"handle exceptions from RecoveryFailed signal handler" in {
|
||||||
val probe = TestProbe[String]()
|
val probe = TestProbe[String]()
|
||||||
val pa = spawn(failingPersistentActor(PersistenceId("fail-recovery-twice"), probe.ref, {
|
val pa = spawn(failingPersistentActor(PersistenceId("fail-recovery-twice"), probe.ref, {
|
||||||
case (_, RecoveryFailed(_)) ⇒
|
case (_, RecoveryFailed(_)) =>
|
||||||
throw TestException("recovery call back failure")
|
throw TestException("recovery call back failure")
|
||||||
}))
|
}))
|
||||||
pa ! "one"
|
pa ! "one"
|
||||||
|
|
@ -169,7 +169,7 @@ class EventSourcedBehaviorFailureSpec
|
||||||
EventFilter[JournalFailureException](occurrences = 1).intercept {
|
EventFilter[JournalFailureException](occurrences = 1).intercept {
|
||||||
// start again and then the event handler will throw
|
// start again and then the event handler will throw
|
||||||
spawn(failingPersistentActor(pid, probe.ref, {
|
spawn(failingPersistentActor(pid, probe.ref, {
|
||||||
case (_, RecoveryFailed(t)) ⇒
|
case (_, RecoveryFailed(t)) =>
|
||||||
excProbe.ref ! t
|
excProbe.ref ! t
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
@ -184,7 +184,7 @@ class EventSourcedBehaviorFailureSpec
|
||||||
spawn(
|
spawn(
|
||||||
Behaviors
|
Behaviors
|
||||||
.supervise(failingPersistentActor(PersistenceId("recovery-ok"), probe.ref, {
|
.supervise(failingPersistentActor(PersistenceId("recovery-ok"), probe.ref, {
|
||||||
case (_, RecoveryCompleted) ⇒
|
case (_, RecoveryCompleted) =>
|
||||||
probe.ref.tell("starting")
|
probe.ref.tell("starting")
|
||||||
throw TestException("recovery call back failure")
|
throw TestException("recovery call back failure")
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
|
|
@ -127,16 +127,16 @@ object EventSourcedBehaviorRetentionSpec {
|
||||||
Effect.none.thenStop()
|
Effect.none.thenStop()
|
||||||
|
|
||||||
},
|
},
|
||||||
eventHandler = (state, evt) ⇒
|
eventHandler = (state, evt) =>
|
||||||
evt match {
|
evt match {
|
||||||
case Incremented(delta) ⇒
|
case Incremented(delta) =>
|
||||||
probe ! ((state, evt))
|
probe ! ((state, evt))
|
||||||
State(state.value + delta, state.history :+ state.value)
|
State(state.value + delta, state.history :+ state.value)
|
||||||
}).receiveSignal {
|
}).receiveSignal {
|
||||||
case (_, RecoveryCompleted) => ()
|
case (_, RecoveryCompleted) => ()
|
||||||
case (_, SnapshotCompleted(metadata)) ⇒
|
case (_, SnapshotCompleted(metadata)) =>
|
||||||
snapshotProbe ! Success(metadata)
|
snapshotProbe ! Success(metadata)
|
||||||
case (_, SnapshotFailed(_, failure)) ⇒
|
case (_, SnapshotFailed(_, failure)) =>
|
||||||
snapshotProbe ! Failure(failure)
|
snapshotProbe ! Failure(failure)
|
||||||
case (_, e: EventSourcedSignal) =>
|
case (_, e: EventSourcedSignal) =>
|
||||||
retentionProbe ! Success(e)
|
retentionProbe ! Success(e)
|
||||||
|
|
@ -303,7 +303,7 @@ class EventSourcedBehaviorRetentionSpec
|
||||||
val replyProbe = TestProbe[State]()
|
val replyProbe = TestProbe[State]()
|
||||||
|
|
||||||
val persistentActor = spawn(
|
val persistentActor = spawn(
|
||||||
Behaviors.setup[Command](ctx ⇒
|
Behaviors.setup[Command](ctx =>
|
||||||
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
||||||
.withRetention(RetentionCriteria.snapshotEvery(numberOfEvents = 3, keepNSnapshots = 2))))
|
.withRetention(RetentionCriteria.snapshotEvery(numberOfEvents = 3, keepNSnapshots = 2))))
|
||||||
|
|
||||||
|
|
@ -336,7 +336,7 @@ class EventSourcedBehaviorRetentionSpec
|
||||||
|
|
||||||
val persistentActor = spawn(
|
val persistentActor = spawn(
|
||||||
Behaviors.setup[Command](
|
Behaviors.setup[Command](
|
||||||
ctx ⇒
|
ctx =>
|
||||||
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref).withRetention(
|
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref).withRetention(
|
||||||
// tests the Java API as well
|
// tests the Java API as well
|
||||||
RetentionCriteria.snapshotEvery(numberOfEvents = 3, keepNSnapshots = 2).withDeleteEventsOnSnapshot)))
|
RetentionCriteria.snapshotEvery(numberOfEvents = 3, keepNSnapshots = 2).withDeleteEventsOnSnapshot)))
|
||||||
|
|
@ -382,7 +382,7 @@ class EventSourcedBehaviorRetentionSpec
|
||||||
|
|
||||||
val persistentActor = spawn(
|
val persistentActor = spawn(
|
||||||
Behaviors.setup[Command](
|
Behaviors.setup[Command](
|
||||||
ctx ⇒
|
ctx =>
|
||||||
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
||||||
.snapshotWhen((_, _, seqNr) => seqNr == 3 || seqNr == 13)
|
.snapshotWhen((_, _, seqNr) => seqNr == 3 || seqNr == 13)
|
||||||
.withRetention(RetentionCriteria.snapshotEvery(numberOfEvents = 5, keepNSnapshots = 1))))
|
.withRetention(RetentionCriteria.snapshotEvery(numberOfEvents = 5, keepNSnapshots = 1))))
|
||||||
|
|
@ -419,7 +419,7 @@ class EventSourcedBehaviorRetentionSpec
|
||||||
|
|
||||||
val persistentActor = spawn(
|
val persistentActor = spawn(
|
||||||
Behaviors.setup[Command](
|
Behaviors.setup[Command](
|
||||||
ctx ⇒
|
ctx =>
|
||||||
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
||||||
.snapshotWhen((_, _, seqNr) => seqNr == 3 || seqNr == 13)
|
.snapshotWhen((_, _, seqNr) => seqNr == 3 || seqNr == 13)
|
||||||
.withRetention(
|
.withRetention(
|
||||||
|
|
@ -468,7 +468,7 @@ class EventSourcedBehaviorRetentionSpec
|
||||||
val replyProbe = TestProbe[State]()
|
val replyProbe = TestProbe[State]()
|
||||||
|
|
||||||
val persistentActor = spawn(
|
val persistentActor = spawn(
|
||||||
Behaviors.setup[Command](ctx ⇒
|
Behaviors.setup[Command](ctx =>
|
||||||
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref)
|
||||||
.withRetention(RetentionCriteria.snapshotEvery(numberOfEvents = 1, keepNSnapshots = 3))))
|
.withRetention(RetentionCriteria.snapshotEvery(numberOfEvents = 1, keepNSnapshots = 3))))
|
||||||
|
|
||||||
|
|
@ -508,7 +508,7 @@ class EventSourcedBehaviorRetentionSpec
|
||||||
val replyProbe = TestProbe[State]()
|
val replyProbe = TestProbe[State]()
|
||||||
|
|
||||||
val persistentActor = spawn(
|
val persistentActor = spawn(
|
||||||
Behaviors.setup[Command](ctx ⇒
|
Behaviors.setup[Command](ctx =>
|
||||||
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref).withRetention(
|
counterWithSnapshotAndRetentionProbe(ctx, pid, snapshotProbe.ref, retentionProbe.ref).withRetention(
|
||||||
RetentionCriteria.snapshotEvery(numberOfEvents = 1, keepNSnapshots = 3).withDeleteEventsOnSnapshot)))
|
RetentionCriteria.snapshotEvery(numberOfEvents = 1, keepNSnapshots = 3).withDeleteEventsOnSnapshot)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -277,16 +277,16 @@ object EventSourcedBehaviorSpec {
|
||||||
Effect.none.thenStop()
|
Effect.none.thenStop()
|
||||||
|
|
||||||
},
|
},
|
||||||
eventHandler = (state, evt) ⇒
|
eventHandler = (state, evt) =>
|
||||||
evt match {
|
evt match {
|
||||||
case Incremented(delta) ⇒
|
case Incremented(delta) =>
|
||||||
probe ! ((state, evt))
|
probe ! ((state, evt))
|
||||||
State(state.value + delta, state.history :+ state.value)
|
State(state.value + delta, state.history :+ state.value)
|
||||||
}).receiveSignal {
|
}).receiveSignal {
|
||||||
case (_, RecoveryCompleted) ⇒ ()
|
case (_, RecoveryCompleted) => ()
|
||||||
case (_, SnapshotCompleted(metadata)) ⇒
|
case (_, SnapshotCompleted(metadata)) =>
|
||||||
snapshotProbe ! Success(metadata)
|
snapshotProbe ! Success(metadata)
|
||||||
case (_, SnapshotFailed(_, failure)) ⇒
|
case (_, SnapshotFailed(_, failure)) =>
|
||||||
snapshotProbe ! Failure(failure)
|
snapshotProbe ! Failure(failure)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,15 @@ class EventSourcedSequenceNumberSpec
|
||||||
system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1)))
|
system.toUntyped.eventStream.publish(Mute(EventFilter.warning(start = "No default snapshot store", occurrences = 1)))
|
||||||
|
|
||||||
private def behavior(pid: PersistenceId, probe: ActorRef[String]): Behavior[String] =
|
private def behavior(pid: PersistenceId, probe: ActorRef[String]): Behavior[String] =
|
||||||
Behaviors.setup(ctx ⇒
|
Behaviors.setup(ctx =>
|
||||||
EventSourcedBehavior[String, String, String](pid, "", { (_, command) =>
|
EventSourcedBehavior[String, String, String](pid, "", { (_, command) =>
|
||||||
probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " onCommand")
|
probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " onCommand")
|
||||||
Effect.persist(command).thenRun(_ ⇒ probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " thenRun"))
|
Effect.persist(command).thenRun(_ => probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " thenRun"))
|
||||||
}, { (state, evt) ⇒
|
}, { (state, evt) =>
|
||||||
probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " eventHandler")
|
probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " eventHandler")
|
||||||
state + evt
|
state + evt
|
||||||
}).receiveSignal {
|
}).receiveSignal {
|
||||||
case (_, RecoveryCompleted) ⇒
|
case (_, RecoveryCompleted) =>
|
||||||
probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " onRecoveryComplete")
|
probe ! (EventSourcedBehavior.lastSequenceNumber(ctx) + " onRecoveryComplete")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,18 +32,18 @@ class LoggerSourceSpec
|
||||||
private val pidCounter = new AtomicInteger(0)
|
private val pidCounter = new AtomicInteger(0)
|
||||||
private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})")
|
private def nextPid(): PersistenceId = PersistenceId(s"c${pidCounter.incrementAndGet()})")
|
||||||
|
|
||||||
def behavior: Behavior[String] = Behaviors.setup { ctx ⇒
|
def behavior: Behavior[String] = Behaviors.setup { ctx =>
|
||||||
ctx.log.info("setting-up-behavior")
|
ctx.log.info("setting-up-behavior")
|
||||||
EventSourcedBehavior[String, String, String](nextPid(), emptyState = "", commandHandler = (_, _) => {
|
EventSourcedBehavior[String, String, String](nextPid(), emptyState = "", commandHandler = (_, _) => {
|
||||||
ctx.log.info("command-received")
|
ctx.log.info("command-received")
|
||||||
Effect.persist("evt")
|
Effect.persist("evt")
|
||||||
}, eventHandler = (state, _) ⇒ {
|
}, eventHandler = (state, _) => {
|
||||||
ctx.log.info("event-received")
|
ctx.log.info("event-received")
|
||||||
state
|
state
|
||||||
}).receiveSignal {
|
}).receiveSignal {
|
||||||
case (_, RecoveryCompleted) ⇒ ctx.log.info("recovery-completed")
|
case (_, RecoveryCompleted) => ctx.log.info("recovery-completed")
|
||||||
case (_, SnapshotCompleted(_)) ⇒
|
case (_, SnapshotCompleted(_)) =>
|
||||||
case (_, SnapshotFailed(_, _)) ⇒
|
case (_, SnapshotFailed(_, _)) =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ class LoggerSourceSpec
|
||||||
def eventFilterFor(logMsg: String) =
|
def eventFilterFor(logMsg: String) =
|
||||||
EventFilter.custom(
|
EventFilter.custom(
|
||||||
{
|
{
|
||||||
case l: LogEvent if l.message == logMsg ⇒
|
case l: LogEvent if l.message == logMsg =>
|
||||||
if (l.logClass == classOf[LoggerSourceSpec]) true
|
if (l.logClass == classOf[LoggerSourceSpec]) true
|
||||||
else fail(s"Unexpected log source: ${l.logClass} for message ${l.message}")
|
else fail(s"Unexpected log source: ${l.logClass} for message ${l.message}")
|
||||||
case _ => false
|
case _ => false
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class NullEmptyStateSpec extends ScalaTestWithActorTestKit(NullEmptyStateSpec.co
|
||||||
probe.tell("eventHandler:" + state + ":" + event)
|
probe.tell("eventHandler:" + state + ":" + event)
|
||||||
if (state == null) event else state + event
|
if (state == null) event else state + event
|
||||||
}).receiveSignal {
|
}).receiveSignal {
|
||||||
case (state, RecoveryCompleted) ⇒
|
case (state, RecoveryCompleted) =>
|
||||||
probe.tell("onRecoveryCompleted:" + state)
|
probe.tell("onRecoveryCompleted:" + state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,11 +78,11 @@ object PerformanceSpec {
|
||||||
persistenceId = PersistenceId(name),
|
persistenceId = PersistenceId(name),
|
||||||
"",
|
"",
|
||||||
commandHandler = CommandHandler.command {
|
commandHandler = CommandHandler.command {
|
||||||
case StopMeasure ⇒
|
case StopMeasure =>
|
||||||
Effect.none.thenRun(_ => probe.ref ! StopMeasure)
|
Effect.none.thenRun(_ => probe.ref ! StopMeasure)
|
||||||
case FailAt(sequence) ⇒
|
case FailAt(sequence) =>
|
||||||
Effect.none.thenRun(_ => parameters.failAt = sequence)
|
Effect.none.thenRun(_ => parameters.failAt = sequence)
|
||||||
case command ⇒ other(command, parameters)
|
case command => other(command, parameters)
|
||||||
},
|
},
|
||||||
eventHandler = {
|
eventHandler = {
|
||||||
case (state, _) => state
|
case (state, _) => state
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ object PersistentActorCompileOnlyTest {
|
||||||
case IntentRecorded(correlationId, data) =>
|
case IntentRecorded(correlationId, data) =>
|
||||||
EventsInFlight(
|
EventsInFlight(
|
||||||
nextCorrelationId = correlationId + 1,
|
nextCorrelationId = correlationId + 1,
|
||||||
dataByCorrelationId = state.dataByCorrelationId + (correlationId → data))
|
dataByCorrelationId = state.dataByCorrelationId + (correlationId -> data))
|
||||||
case SideEffectAcknowledged(correlationId) =>
|
case SideEffectAcknowledged(correlationId) =>
|
||||||
state.copy(dataByCorrelationId = state.dataByCorrelationId - correlationId)
|
state.copy(dataByCorrelationId = state.dataByCorrelationId - correlationId)
|
||||||
}).receiveSignal {
|
}).receiveSignal {
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ object BasicPersistentBehaviorCompileOnly {
|
||||||
commandHandler = (state, cmd) => throw new RuntimeException("TODO: process the command & return an Effect"),
|
commandHandler = (state, cmd) => throw new RuntimeException("TODO: process the command & return an Effect"),
|
||||||
eventHandler = (state, evt) => throw new RuntimeException("TODO: process the event return the next state"))
|
eventHandler = (state, evt) => throw new RuntimeException("TODO: process the event return the next state"))
|
||||||
.receiveSignal {
|
.receiveSignal {
|
||||||
case (state, RecoveryCompleted) ⇒
|
case (state, RecoveryCompleted) =>
|
||||||
throw new RuntimeException("TODO: add some end-of-recovery side-effect here")
|
throw new RuntimeException("TODO: add some end-of-recovery side-effect here")
|
||||||
}
|
}
|
||||||
//#recovery
|
//#recovery
|
||||||
|
|
@ -109,7 +109,7 @@ object BasicPersistentBehaviorCompileOnly {
|
||||||
commandHandler = (state, cmd) => throw new RuntimeException("TODO: process the command & return an Effect"),
|
commandHandler = (state, cmd) => throw new RuntimeException("TODO: process the command & return an Effect"),
|
||||||
eventHandler = (state, evt) => throw new RuntimeException("TODO: process the event return the next state"))
|
eventHandler = (state, evt) => throw new RuntimeException("TODO: process the event return the next state"))
|
||||||
.receiveSignal {
|
.receiveSignal {
|
||||||
case (state, RecoveryCompleted) ⇒
|
case (state, RecoveryCompleted) =>
|
||||||
throw new RuntimeException("TODO: add some end-of-recovery side-effect here")
|
throw new RuntimeException("TODO: add some end-of-recovery side-effect here")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class FanoutProcessorSpec extends StreamSpec {
|
||||||
val (promise, publisher) = Source.repeat(1).toMat(Sink.asPublisher(true))(Keep.both).run()
|
val (promise, publisher) = Source.repeat(1).toMat(Sink.asPublisher(true))(Keep.both).run()
|
||||||
val publisherRef = publisher.asInstanceOf[ActorPublisher[Int]].impl
|
val publisherRef = publisher.asInstanceOf[ActorPublisher[Int]].impl
|
||||||
probe.watch(publisherRef)
|
probe.watch(publisherRef)
|
||||||
Source.fromPublisher(publisher).map(_ ⇒ throw TE("boom")).runWith(Sink.ignore)
|
Source.fromPublisher(publisher).map(_ => throw TE("boom")).runWith(Sink.ignore)
|
||||||
probe.expectTerminated(publisherRef)
|
probe.expectTerminated(publisherRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ class LazySinkSpec extends StreamSpec {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val result = Source(List("whatever")).runWith(Sink.lazyInitAsync[String, NotUsed](() ⇒ {
|
val result = Source(List("whatever")).runWith(Sink.lazyInitAsync[String, NotUsed](() => {
|
||||||
Future.successful(Sink.fromGraph(FailingInnerMat))
|
Future.successful(Sink.fromGraph(FailingInnerMat))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
@ -139,8 +139,8 @@ class LazySinkSpec extends StreamSpec {
|
||||||
"lazily propagate failure" in {
|
"lazily propagate failure" in {
|
||||||
case object MyException extends Exception
|
case object MyException extends Exception
|
||||||
val lazyMatVal = Source(List(1))
|
val lazyMatVal = Source(List(1))
|
||||||
.concat(Source.lazily(() ⇒ Source.failed(MyException)))
|
.concat(Source.lazily(() => Source.failed(MyException)))
|
||||||
.runWith(Sink.lazyInitAsync(() ⇒ Future.successful(Sink.seq[Int])))
|
.runWith(Sink.lazyInitAsync(() => Future.successful(Sink.seq[Int])))
|
||||||
|
|
||||||
// lazy init async materialized a sink, so we should have a some here
|
// lazy init async materialized a sink, so we should have a some here
|
||||||
val innerMatVal: Future[immutable.Seq[Int]] = lazyMatVal.futureValue.get
|
val innerMatVal: Future[immutable.Seq[Int]] = lazyMatVal.futureValue.get
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,12 @@ private object ActorRefSource {
|
||||||
inheritedAttributes.get[Attributes.Name].map(_.n).getOrElse(super.stageActorName)
|
inheritedAttributes.get[Attributes.Name].map(_.n).getOrElse(super.stageActorName)
|
||||||
|
|
||||||
val ref: ActorRef = getEagerStageActor(eagerMaterializer, poisonPillCompatibility = true) {
|
val ref: ActorRef = getEagerStageActor(eagerMaterializer, poisonPillCompatibility = true) {
|
||||||
case (_, PoisonPill) ⇒
|
case (_, PoisonPill) =>
|
||||||
log.warning("for backwards compatibility: PoisonPill will not be supported in the future")
|
log.warning("for backwards compatibility: PoisonPill will not be supported in the future")
|
||||||
completeStage()
|
completeStage()
|
||||||
case (_, m) if failureMatcher.isDefinedAt(m) ⇒
|
case (_, m) if failureMatcher.isDefinedAt(m) =>
|
||||||
failStage(failureMatcher(m))
|
failStage(failureMatcher(m))
|
||||||
case (_, m) if completionMatcher.isDefinedAt(m) ⇒
|
case (_, m) if completionMatcher.isDefinedAt(m) =>
|
||||||
completionMatcher(m) match {
|
completionMatcher(m) match {
|
||||||
case CompletionStrategy.Draining =>
|
case CompletionStrategy.Draining =>
|
||||||
isCompleting = true
|
isCompleting = true
|
||||||
|
|
@ -65,7 +65,7 @@ private object ActorRefSource {
|
||||||
case CompletionStrategy.Immediately =>
|
case CompletionStrategy.Immediately =>
|
||||||
completeStage()
|
completeStage()
|
||||||
}
|
}
|
||||||
case (_, m: T @unchecked) ⇒
|
case (_, m: T @unchecked) =>
|
||||||
buffer match {
|
buffer match {
|
||||||
case OptionVal.None =>
|
case OptionVal.None =>
|
||||||
if (isCompleting) {
|
if (isCompleting) {
|
||||||
|
|
@ -87,37 +87,37 @@ private object ActorRefSource {
|
||||||
tryPush()
|
tryPush()
|
||||||
} else
|
} else
|
||||||
overflowStrategy match {
|
overflowStrategy match {
|
||||||
case s: DropHead ⇒
|
case s: DropHead =>
|
||||||
log.log(
|
log.log(
|
||||||
s.logLevel,
|
s.logLevel,
|
||||||
"Dropping the head element because buffer is full and overflowStrategy is: [DropHead]")
|
"Dropping the head element because buffer is full and overflowStrategy is: [DropHead]")
|
||||||
buf.dropHead()
|
buf.dropHead()
|
||||||
buf.enqueue(m)
|
buf.enqueue(m)
|
||||||
tryPush()
|
tryPush()
|
||||||
case s: DropTail ⇒
|
case s: DropTail =>
|
||||||
log.log(
|
log.log(
|
||||||
s.logLevel,
|
s.logLevel,
|
||||||
"Dropping the tail element because buffer is full and overflowStrategy is: [DropTail]")
|
"Dropping the tail element because buffer is full and overflowStrategy is: [DropTail]")
|
||||||
buf.dropTail()
|
buf.dropTail()
|
||||||
buf.enqueue(m)
|
buf.enqueue(m)
|
||||||
tryPush()
|
tryPush()
|
||||||
case s: DropBuffer ⇒
|
case s: DropBuffer =>
|
||||||
log.log(
|
log.log(
|
||||||
s.logLevel,
|
s.logLevel,
|
||||||
"Dropping all the buffered elements because buffer is full and overflowStrategy is: [DropBuffer]")
|
"Dropping all the buffered elements because buffer is full and overflowStrategy is: [DropBuffer]")
|
||||||
buf.clear()
|
buf.clear()
|
||||||
buf.enqueue(m)
|
buf.enqueue(m)
|
||||||
tryPush()
|
tryPush()
|
||||||
case s: DropNew ⇒
|
case s: DropNew =>
|
||||||
log.log(
|
log.log(
|
||||||
s.logLevel,
|
s.logLevel,
|
||||||
"Dropping the new element because buffer is full and overflowStrategy is: [DropNew]")
|
"Dropping the new element because buffer is full and overflowStrategy is: [DropNew]")
|
||||||
case s: Fail ⇒
|
case s: Fail =>
|
||||||
log.log(s.logLevel, "Failing because buffer is full and overflowStrategy is: [Fail]")
|
log.log(s.logLevel, "Failing because buffer is full and overflowStrategy is: [Fail]")
|
||||||
val bufferOverflowException =
|
val bufferOverflowException =
|
||||||
BufferOverflowException(s"Buffer overflow (max capacity was: $maxBuffer)!")
|
BufferOverflowException(s"Buffer overflow (max capacity was: $maxBuffer)!")
|
||||||
failStage(bufferOverflowException)
|
failStage(bufferOverflowException)
|
||||||
case _: Backpressure ⇒
|
case _: Backpressure =>
|
||||||
// there is a precondition check in Source.actorRefSource factory method to not allow backpressure as strategy
|
// there is a precondition check in Source.actorRefSource factory method to not allow backpressure as strategy
|
||||||
failStage(new IllegalStateException("Backpressure is not supported"))
|
failStage(new IllegalStateException("Backpressure is not supported"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ object GraphStageLogic {
|
||||||
|
|
||||||
private val functionRef: FunctionRef = {
|
private val functionRef: FunctionRef = {
|
||||||
val f: (ActorRef, Any) => Unit = {
|
val f: (ActorRef, Any) => Unit = {
|
||||||
case (r, PoisonPill) if poisonPillFallback ⇒
|
case (r, PoisonPill) if poisonPillFallback =>
|
||||||
callback.invoke((r, PoisonPill))
|
callback.invoke((r, PoisonPill))
|
||||||
case (_, m @ (PoisonPill | Kill)) =>
|
case (_, m @ (PoisonPill | Kill)) =>
|
||||||
materializer.logger.warning(
|
materializer.logger.warning(
|
||||||
|
|
@ -1234,9 +1234,9 @@ abstract class GraphStageLogic private[stream] (val inCount: Int, val outCount:
|
||||||
protected[akka] def getEagerStageActor(
|
protected[akka] def getEagerStageActor(
|
||||||
eagerMaterializer: Materializer,
|
eagerMaterializer: Materializer,
|
||||||
poisonPillCompatibility: Boolean)( // fallback required for source actor backwards compatibility
|
poisonPillCompatibility: Boolean)( // fallback required for source actor backwards compatibility
|
||||||
receive: ((ActorRef, Any)) ⇒ Unit): StageActor =
|
receive: ((ActorRef, Any)) => Unit): StageActor =
|
||||||
_stageActor match {
|
_stageActor match {
|
||||||
case null ⇒
|
case null =>
|
||||||
val actorMaterializer = ActorMaterializerHelper.downcast(eagerMaterializer)
|
val actorMaterializer = ActorMaterializerHelper.downcast(eagerMaterializer)
|
||||||
_stageActor =
|
_stageActor =
|
||||||
new StageActor(actorMaterializer, getAsyncCallback, receive, stageActorName, poisonPillCompatibility)
|
new StageActor(actorMaterializer, getAsyncCallback, receive, stageActorName, poisonPillCompatibility)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue