VirtualTam's bookmarks

  1.  1// THIS WILL SEND AN INTERRUPT TO ALL MATCHING THREADS
     2Thread.getAllStackTraces().keySet().each() {
     3  t -> if (t.getName().contains("PATTERN") ) { t.interrupt(); }
     4}
     5
     6// THIS WILL FORCE-STOP ALL MATCHING THREADS
     7// May be required for recursive loops
     8Thread.getAllStackTraces().keySet().each() {
     9  t -> if (t.getName().contains("PATTERN") ) { t.stop(); }
    10}
    
  2. Implementation for OOP generic objects, starting with 3.5 : )

    See https://docs.python.org/3.5/library/typing.html