public class ServletWaiter<T> extends ServiceWaiter<T>
We don't want to use service waiters as a permanent solution, as that will result in a zillion servlet threads hanging around waiting for results all over the goddamned place. Instead we want to rearchitect Jetty to support asynchronous servlets that give up their thread when they need to block and grab a new thread out of the pool when they're ready to go again. This is a tall order, but I think they might be working on something like this for Jetty 6.0.
ServiceWaiter.TimeoutExceptionResultListener.NOOP<T>NO_TIMEOUTNOOP| Constructor and Description |
|---|
ServletWaiter(String ident) |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
queueAndWait(RunQueue runq,
String name,
Callable<T> action)
Posts a result getter to be executed on the run queue thread and blocks waiting for the
result.
|
T |
waitForResult()
Waits for our asynchronous result and returns it if all is well.
|
awaitFriendlyResponsegetArgument, getError, postFailure, postSuccess, requestCompleted, requestFailed, reset, setTimeout, waitForResponsepublic ServletWaiter(String ident)
public T waitForResult() throws ServiceException
ServiceException is thrown.ServiceExceptionpublic static <T> T queueAndWait(RunQueue runq, String name, Callable<T> action) throws ServiceException
ServiceExceptionCopyright © 2015. All rights reserved.