class NTCPSendFinisher extends Object
| Constructor and Description |
|---|
NTCPSendFinisher(I2PAppContext context,
NTCPTransport transport)Create a new send finisher. |
| Modifier and Type | Method and Description |
|---|---|
void | add(OutNetMessage msg)Adds a message to the finishing queue to call afterSend asynchronously. |
void | adjustThreads(int newMax)Adjusts the thread pool size for the running executor. |
int | getActiveCount()Returns the number of threads currently processing tasks. |
static int | getMaxThreads()Returns the current max send finisher threads. |
int | getPoolSize()Returns the current pool size (total threads). |
static int | getQueueCapacity()Returns the current send finisher queue capacity. |
int | getQueueSize()Returns the current queue size (pending send-finish tasks). |
double | getUtilization()Get send finisher pool utilization as a ratio (0.0-1.0). |
static void | setMaxThreads(int threads)Sets the max send finisher threads for new instances. |
static void | setQueueCapacity(int capacity)Sets the send finisher queue capacity for new instances. |
void | start()Starts the thread pool executor for processing send finish tasks. |
void | stop()Stops the thread pool executor, waiting briefly for termination. |
public NTCPSendFinisher(I2PAppContext context, NTCPTransport transport)
context - the I2P app contexttransport - the NTCP transportpublic void add(OutNetMessage msg)
msg - the message to process after sendingpublic void adjustThreads(int newMax)
newMax - the new max thread countpublic int getActiveCount()
public static int getMaxThreads()
public int getPoolSize()
public static int getQueueCapacity()
public int getQueueSize()
public double getUtilization()
public static void setMaxThreads(int threads)
threads - the new max thread countpublic static void setQueueCapacity(int capacity)
capacity - the new queue capacitypublic void start()
public void stop()