Proof-of-concept for the new Remoting codenamed Artery

This commit is contained in:
Endre Sándor Varga 2016-04-14 10:26:09 +02:00
parent 92ec6785b8
commit 3fd052b868
10 changed files with 283 additions and 13 deletions

View file

@ -7,16 +7,19 @@ package akka.remote
import akka.Done
import akka.actor._
import akka.dispatch.sysmsg._
import akka.event.{ Logging, LoggingAdapter, EventStream }
import akka.event.{ EventStream, Logging, LoggingAdapter }
import akka.event.Logging.Error
import akka.serialization.{ Serialization, SerializationExtension }
import akka.pattern.pipe
import scala.util.control.NonFatal
import akka.actor.SystemGuardian.{ TerminationHookDone, TerminationHook, RegisterTerminationHook }
import akka.actor.SystemGuardian.{ RegisterTerminationHook, TerminationHook, TerminationHookDone }
import scala.util.control.Exception.Catcher
import scala.concurrent.Future
import akka.ConfigurationException
import akka.dispatch.{ RequiresMessageQueue, UnboundedMessageQueueSemantics }
import akka.remote.artery.ArterySubsystem
/**
* INTERNAL API
@ -179,7 +182,7 @@ private[akka] class RemoteActorRefProvider(
d
},
serialization = SerializationExtension(system),
transport = new Remoting(system, this))
transport = if (remoteSettings.EnableArtery) new ArterySubsystem(system, this) else new Remoting(system, this))
_internals = internals
remotingTerminator ! internals
@ -422,6 +425,7 @@ private[akka] class RemoteActorRefProvider(
/**
* Marks a remote system as out of sync and prevents reconnects until the quarantine timeout elapses.
*
* @param address Address of the remote system to be quarantined
* @param uid UID of the remote system, if the uid is not defined it will not be a strong quarantine but
* the current endpoint writer will be stopped (dropping system messages) and the address will be gated
@ -448,6 +452,8 @@ private[akka] class RemoteActorRef private[akka] (
deploy: Option[Deploy])
extends InternalActorRef with RemoteRef {
@volatile var cachedAssociation: artery.Association = null
def getChild(name: Iterator[String]): InternalActorRef = {
val s = name.toStream
s.headOption match {