summaryrefslogtreecommitdiff
path: root/docs/examples/auction.scala
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/auction.scala')
-rw-r--r--docs/examples/auction.scala12
1 files changed, 11 insertions, 1 deletions
diff --git a/docs/examples/auction.scala b/docs/examples/auction.scala
index 44f4318074..a7d5119aae 100644
--- a/docs/examples/auction.scala
+++ b/docs/examples/auction.scala
@@ -115,7 +115,7 @@ object auction {
log("auctionConcluded")
}
case AuctionOver() => {
- running = false;
+ running = false
log("auctionOver")
}
}
@@ -123,11 +123,21 @@ object auction {
}
}
+ def kill(delay: Int) = new java.util.Timer().schedule(
+ new java.util.TimerTask {
+ override def run() = {
+ Console.println("[killed]")
+ System.exit(0)
+ }
+ },
+ delay) // in milliseconds
+
def main(args: Array[String]) = {
seller.start()
auction.start()
client(1, 20, 200).start()
client(2, 10, 300).start()
+ kill(20000)
}
}