Package org.teiid.dqp.internal.process

Examples of org.teiid.dqp.internal.process.ThreadReuseExecutor.scheduleAtFixedRate()


      pool.execute(new FakeWorkItem(1));
    }
   
    @Test public void testScheduleCancel() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
      ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
        @Override
        public void run() {
        }
      }, 0, 5, TimeUnit.MILLISECONDS);
      future.cancel(true);
View Full Code Here


     * Here each execution exceeds the period
     */
    @Test public void testScheduleRepeated() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
      final ArrayList<String> result = new ArrayList<String>();
      ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
        @Override
        public void run() {
          result.add("hello"); //$NON-NLS-1$
          try {
          Thread.sleep(70);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.