Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
Feb. 6, 2013, 5:59 p.m.
FORMAT:
Text only
SIZE:
528 Bytes
Raw
Download
Tweet
HITS:
1363
Go to comments
Report
class Ping(count: int, pong: Actor) extends Actor {
def act() {
var pingsLeft = count - 1
pong ! Ping
while (true) {
receive {
case Pong =>
if (pingsLeft % 1000 == 0)
Console.println("Ping: pong")
if (pingsLeft > 0) {
pong ! Ping
pingsLeft -= 1
} else {
Console.println("Ping: stop")
pong ! Stop
exit()
}
}
}
}
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus