Package io.netty.handler.codec.quic
Interface FlushStrategy
-
public interface FlushStrategy
Allows to configure a strategy for when flushes should be happening.
-
-
Field Summary
Fields Modifier and Type Field Description static FlushStrategy
DEFAULT
DefaultFlushStrategy
implementation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static FlushStrategy
afterNumBytes(int bytes)
Implementation that flushes after a number of bytes.static FlushStrategy
afterNumPackets(int packets)
Implementation that flushes after a number of packets.boolean
shouldFlushNow(int numPackets, int numBytes)
Returnstrue
if a flush should happen now,false
otherwise.
-
-
-
Field Detail
-
DEFAULT
static final FlushStrategy DEFAULT
DefaultFlushStrategy
implementation.
-
-
Method Detail
-
shouldFlushNow
boolean shouldFlushNow(int numPackets, int numBytes)
Returnstrue
if a flush should happen now,false
otherwise.- Parameters:
numPackets
- the number of packets that were written since the last flush.numBytes
- the number of bytes that were written since the last flush.- Returns:
true
if a flush should be done now,false
otherwise.
-
afterNumBytes
static FlushStrategy afterNumBytes(int bytes)
Implementation that flushes after a number of bytes.- Parameters:
bytes
- the number of bytes after which we should issue a flush.- Returns:
- the
FlushStrategy
.
-
afterNumPackets
static FlushStrategy afterNumPackets(int packets)
Implementation that flushes after a number of packets.- Parameters:
packets
- the number of packets after which we should issue a flush.- Returns:
- the
FlushStrategy
.
-
-