public static final class InboundMessageHandler.WaitQueue
extends java.lang.Object
InboundMessageHandler.WaitQueue
of the appropriate kind (either ENDPOINT or GLOBAL - if failed
to allocate endpoint or global reserve capacity, respectively), stops processing any
accumulated frames or receiving new ones, and waits - until reactivated.
Every time permits are returned to an endpoint or global ResourceLimits.Limit
, the respective
queue gets signalled, and if there are any handlers registered in it, we will attempt
to reactivate as many waiting handlers as current available reserve capacity allows
us to - immediately, on the signal()
-calling thread. At most one such attempt
will be in progress at any given time.
Handlers that can be reactivated will be grouped by their EventLoop
and a single
ReactivateHandlers
task will be scheduled per event loop, on the corresponding
event loops.
When run, the ReactivateHandlers
task will ask each handler in its group to first
process one message - using preallocated reserve capacity - and if no obstacles were met -
reactivate the handlers, this time using their regular reserves.
See schedule()
, ReactivateHandlers#run()
, Ticket#reactivateHandler(Limit)
.Modifier and Type | Method and Description |
---|---|
static InboundMessageHandler.WaitQueue |
endpoint(ResourceLimits.Limit endpointReserveCapacity) |
static InboundMessageHandler.WaitQueue |
global(ResourceLimits.Limit globalReserveCapacity) |
public static InboundMessageHandler.WaitQueue endpoint(ResourceLimits.Limit endpointReserveCapacity)
public static InboundMessageHandler.WaitQueue global(ResourceLimits.Limit globalReserveCapacity)
Copyright © 2009-2020 The Apache Software Foundation