removed some deprecation warnings from akka-contrib
This commit is contained in:
parent
3e8597d94b
commit
3ffabf00ec
5 changed files with 14 additions and 14 deletions
|
|
@ -45,7 +45,7 @@ object ReliableProxy {
|
|||
case class Ack(serial: Int)
|
||||
case object Tick
|
||||
|
||||
def receiver(target: ActorRef): Props = Props(new Receiver(target))
|
||||
def receiver(target: ActorRef): Props = Props(classOf[Receiver], target)
|
||||
|
||||
sealed trait State
|
||||
case object Idle extends State
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
|
|||
|
||||
system.actorSelection(node(remote) / "user" / "echo") ! Identify("echo")
|
||||
target = expectMsgType[ActorIdentity].ref.get
|
||||
proxy = system.actorOf(Props(new ReliableProxy(target, 100.millis)), "proxy")
|
||||
proxy = system.actorOf(Props(classOf[ReliableProxy], target, 100.millis), "proxy")
|
||||
//#demo
|
||||
proxy ! FSM.SubscribeTransitionCallBack(testActor)
|
||||
expectState(Idle)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class PeekMailboxSpec extends AkkaSpec("""
|
|||
"A PeekMailbox" must {
|
||||
|
||||
"retry messages" in {
|
||||
val a = system.actorOf(Props(new PeekActor(1)).withDispatcher("peek-dispatcher"))
|
||||
val a = system.actorOf(Props(classOf[PeekActor], 1).withDispatcher("peek-dispatcher"))
|
||||
a ! "hello"
|
||||
expectMsg("hello")
|
||||
EventFilter[RuntimeException]("DONTWANNA", occurrences = 1) intercept {
|
||||
|
|
@ -57,7 +57,7 @@ class PeekMailboxSpec extends AkkaSpec("""
|
|||
}
|
||||
|
||||
"put a bound on retries" in {
|
||||
val a = system.actorOf(Props(new PeekActor(0)).withDispatcher("peek-dispatcher"))
|
||||
val a = system.actorOf(Props(classOf[PeekActor], 0).withDispatcher("peek-dispatcher"))
|
||||
EventFilter[RuntimeException]("DONTWANNA", occurrences = 3) intercept {
|
||||
a ! "hello"
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ class PeekMailboxSpec extends AkkaSpec("""
|
|||
}
|
||||
|
||||
"not waste messages on double-ack()" in {
|
||||
val a = system.actorOf(Props(new PeekActor(0)).withDispatcher("peek-dispatcher"))
|
||||
val a = system.actorOf(Props(classOf[PeekActor], 0).withDispatcher("peek-dispatcher"))
|
||||
a ! DoubleAck
|
||||
a ! Check
|
||||
expectMsg(Check)
|
||||
|
|
@ -77,7 +77,7 @@ class PeekMailboxSpec extends AkkaSpec("""
|
|||
|
||||
"support cleanup" in {
|
||||
system.eventStream.subscribe(testActor, classOf[DeadLetter])
|
||||
val a = system.actorOf(Props(new PeekActor(0)).withDispatcher("peek-dispatcher"))
|
||||
val a = system.actorOf(Props(classOf[PeekActor], 0).withDispatcher("peek-dispatcher"))
|
||||
watch(a)
|
||||
EventFilter[RuntimeException]("DONTWANNA", occurrences = 1) intercept {
|
||||
a ! "DIE" // stays in the mailbox
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class ReliableProxyDocSpec extends AkkaSpec with ImplicitSender {
|
|||
val target = system.deadLetters
|
||||
val a = system.actorOf(Props(new Actor {
|
||||
//#demo-transition
|
||||
val proxy = context.actorOf(Props(new ReliableProxy(target, 100.millis)))
|
||||
val proxy = context.actorOf(Props(classOf[ReliableProxy], target, 100.millis))
|
||||
proxy ! FSM.SubscribeTransitionCallBack(self)
|
||||
|
||||
var client: ActorRef = _
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
}
|
||||
}))
|
||||
// The throttler for this example, setting the rate
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(
|
||||
3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler],
|
||||
3 msgsPer (1.second.dilated)))
|
||||
// Set the target
|
||||
throttler ! SetTarget(Some(printer))
|
||||
// These three messages will be sent to the echoer immediately
|
||||
|
|
@ -62,7 +62,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"keep messages until a target is set" in {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
1 to 6 foreach { throttler ! _ }
|
||||
expectNoMsg(1 second)
|
||||
throttler ! SetTarget(Some(echo))
|
||||
|
|
@ -73,7 +73,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"send messages after a `SetTarget(None)` pause" in {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 3 foreach { throttler ! _ }
|
||||
throttler ! SetTarget(None)
|
||||
|
|
@ -91,7 +91,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"keep messages when the target is set to None" in {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 7 foreach { throttler ! _ }
|
||||
throttler ! SetTarget(None)
|
||||
|
|
@ -108,7 +108,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"respect the rate (3 msg/s)" in within(1.5 seconds, 2.5 seconds) {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(3 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 3 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 7 foreach { throttler ! _ }
|
||||
1 to 7 foreach { expectMsg(_) }
|
||||
|
|
@ -116,7 +116,7 @@ class TimerBasedThrottlerSpec extends TestKit(ActorSystem("TimerBasedThrottlerSp
|
|||
|
||||
"respect the rate (4 msg/s)" in within(1.5 seconds, 2.5 seconds) {
|
||||
val echo = system.actorOf(Props[TimerBasedThrottlerSpec.EchoActor])
|
||||
val throttler = system.actorOf(Props(new TimerBasedThrottler(4 msgsPer (1.second.dilated))))
|
||||
val throttler = system.actorOf(Props(classOf[TimerBasedThrottler], 4 msgsPer (1.second.dilated)))
|
||||
throttler ! SetTarget(Some(echo))
|
||||
1 to 9 foreach { throttler ! _ }
|
||||
1 to 9 foreach { expectMsg(_) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue