alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (signals.scala)

This example Scala source code file (signals.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

back, back, hup, hup

The Scala signals.scala source code

// not exactly "pending", here as an example usage.
//
val manager = scala.tools.util.SignalManager

manager.requireInterval(3, manager.INT) {
  case true   => Console.println("\nPress ctrl-C again to exit.")
  case false  => System.exit(1)
}

manager("HUP") = println("HUP 1!")
manager("HUP").raise()

manager("HUP") += println("HUP 2!")
manager("HUP").raise()

manager("HUP") += println("HUP 3!")
manager("HUP").raise()

manager("HUP") = println("Back to HUP 1!")
manager("HUP").raise()

manager.dump()

Other Scala examples (source code examples)

Here is a short list of links related to this Scala signals.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.