synchronized void startFlusher ( ) { // Create a new scheduled executor service with a threadfactory that // creates daemonized threads; this way if the user doesn't exit nicely // the JVM Runtime won't hang flusher = Executors . newScheduledThreadPool ( 1 , new ThreadFactory ( ) { @ Override public Thread newThread ( Runnable r ) { Thread t = Executors . defaultThreadFactory ( ) . newThread ( r ) ; t . setDaemon ( true ) ; return t ; } } ) ; flusher . scheduleWithFixedDelay ( new QueueFlusher ( ) , 0 , flushPeriodMs , TimeUnit . MILLISECONDS ) ; }
Creates and runs a new QueueFlusher thread