@ Override public void recollect ( W buffer ) { if ( queue . size ( ) < preservedBufs ) { long effectiveDrainDelay = drainDelay > 0 ? drainDelay : defaultDrainDelay ; if ( effectiveDrainDelay > 0 ) { // Enqueue buffer . clear ( ) ; queue . add ( buffer ) ; Timer old = idleTimer . getAndSet ( Components . schedule ( this :: drain , Duration . ofMillis ( effectiveDrainDelay ) ) ) ; if ( old != null ) { old . cancel ( ) ; } return ; } } // Discard removeBuffer ( buffer ) ; }
Re - adds the buffer to the pool . The buffer is cleared .