mirror of
https://github.com/jetty/jetty.project.git
synced 2025-02-23 16:05:00 +00:00
Updated idle timeout checking.
Now that applications are notified in a different thread, idleness becomes an event and therefore a new IdleListener interface has been introduced and implemented.
This commit is contained in:
parent
e8d09fad53
commit
0161f780c9
@ -46,7 +46,7 @@ public class AsyncTimeoutTest
|
||||
Executor threadPool = Executors.newCachedThreadPool();
|
||||
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
Generator generator = new Generator(new StandardCompressionFactory.StandardCompressor());
|
||||
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), null, 1, null, generator)
|
||||
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), new TestIdleListener(), 1, null, generator)
|
||||
{
|
||||
@Override
|
||||
public void flush()
|
||||
@ -90,7 +90,7 @@ public class AsyncTimeoutTest
|
||||
Executor threadPool = Executors.newCachedThreadPool();
|
||||
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
Generator generator = new Generator(new StandardCompressionFactory.StandardCompressor());
|
||||
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), null, 1, null, generator)
|
||||
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), new TestIdleListener(), 1, null, generator)
|
||||
{
|
||||
private final AtomicInteger flushes = new AtomicInteger();
|
||||
|
||||
@ -144,4 +144,12 @@ public class AsyncTimeoutTest
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private static class TestIdleListener implements IdleListener
|
||||
{
|
||||
@Override
|
||||
public void onIdle(boolean idle)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user