[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] Preventing queuing of requests when all connections exhausted
|
Hi,
On Wed, Feb 11, 2015 at 12:33 AM, John Gardiner Myers
<jgmyers@xxxxxxxxxxxxxx> wrote:
> On 2/10/2015 3:16 PM, Simone Bordet wrote:
>>
>> You override newExchangeQueue() to provide a Queue with additional room.
>> Then you override enqueue() to return true/false depending on whether you
>> have enqueued or you want to reject enqueuing.
>
> The part I haven't figured out is how to tell how much of cx is currently in
> use, so I can know when to reject enqueuing. If not by splicing in some sort
> of listener into the HttpExchange, that is.
You are subclassing HttpDestinationOverHTTP already so:
@Override
boolean enqueue(...)
{
int cx = getConnectionPool().getConnectionCount().
...
}
--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.