// // $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2011 Three Rings Design, Inc., All Rights Reserved // http://code.google.com/p/narya/ // // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published // by the Free Software Foundation; either version 2.1 of the License, or // (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package com.threerings.web.server; import java.util.concurrent.Callable; import com.samskivert.servlet.util.ServiceWaiter; import com.samskivert.util.RunQueue; import com.threerings.presents.data.InvocationCodes; import com.threerings.presents.server.InvocationException; import com.threerings.web.gwt.ServiceException; import static com.threerings.admin.Log.log; /** * Used to bridge the gap between synchronous servlets and our asynchronous * game server architecture. * *
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.
*/
public class ServletWaiter