ThreadPool Executor not executing threads in GAE

28 views
Skip to first unread message

Devesh Srivastava

unread,
Mar 23, 2015, 9:43:05 AM3/23/15
to google-a...@googlegroups.com

I am trying to use executor framework in Google App engine. Bellow is the code that I am trying to run.

Thread thread = ThreadManager.createBackgroundThread(new Runnable(){
            public void run(){
                          try{
                                  LOGGER.info( "Checking background thread");                            
                                  Thread.sleep(10);
                              }
                          catch (InterruptedException ex){
                                           throw new RuntimeException("Exception:", ex);
                              }
                         }
                    });
ScheduledThreadPoolExecutor executor = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(10, ThreadManager.backgroundThreadFactory());
executor.scheduleAtFixedRate(thread, 0, 30, TimeUnit.MINUTES);

But this doesn't start the thread. But if I use thread.start() it works properly. I have checkedWhitelisted Classes and it does provide Executor classes. So where I am doing it wrong ?

Reply all
Reply to author
Forward
0 new messages