That's what I am using. Specifically: Executors.newScheduledThreadPool(...);
plus other code to schedule via the ScheduledExecutorService, and then to wait for timeout via the ScheduledFuture.get(...) Just wonder if there is a better (lazier) way. Hanson On 8/13/06, Maarten Bosteels <[EMAIL PROTECTED]> wrote:
Maybe a *java.util.concurrent.ScheduledThreadPoolExecutor* could help ? http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html Maarten On 8/13/06, Hanson Char <[EMAIL PROTECTED]> wrote: > > I am not sure how the ExecutorCompletionService can be nicely fitted > here. What we want is a scheduled close operation to be initiated on > each open session after m seconds delay, and abort regardless after n > seconds, even if some of these close operations haven't finished, > where n > m. > > ExecutorCompletionService.submit() allows some tasks to be submitted > for executed, but there doesn't exist something like > ExecutorCompletionService.schedule() that would take a delay > parameter. > > H > > On 8/11/06, Pauls, Karl <[EMAIL PROTECTED]> wrote: > > As discussed on the concurrency list, a good alternate solution to > polling > > would be to use the ExecutorCompletionService class. I generally found > an > > implementation made using the completion service much cleaner than > polling. > > > > Still, the option to poll without generating exceptions will let > implementers > > more efficiently manage their own list of connections. Thanks! > > > > -karl > > > > > -----Original Message----- > > > From: Trustin Lee [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, August 10, 2006 11:21 PM > > > To: [email protected] > > > Subject: Re: Graceful Shutdown ? > > > > > > We noticed this issue before, and implemented similar mechanism in 0.9 > . > > > You > > > could try the latest 0.9.4 release which is a lot better than 0.8.x. > > > > > > Trustin > > > > >
