public class Writer extends Object
adjustThreads().| Constructor and Description |
|---|
Writer(RouterContext ctx)Writer thread pool for the given context. |
| Modifier and Type | Method and Description |
|---|---|
void | adjustThreads()Dynamically adjust thread count to match the target. |
void | connectionClosed(NTCPConnection con)Removes a closed connection from the queues. |
int | getActiveCount()Number of threads currently processing (not parked). |
static int | getThreadCount()Writer thread count. |
double | getUtilization()Writer pool utilization as a ratio (0.0-1.0). |
static void | setThreadCount(int count)Writer thread count, bounded by MIN_THREADS-MAX_THREADS. |
void | startWriting(int numWriters)Starts the given number of writer threads. |
void | stopWriting()Stops all writer threads. |
void | wantsWrite(NTCPConnection con,
String source)Registers a connection to be written. |
public Writer(RouterContext ctx)
public void adjustThreads()
public void connectionClosed(NTCPConnection con)
public int getActiveCount()
public static int getThreadCount()
public double getUtilization()
public static void setThreadCount(int count)
public void startWriting(int numWriters)
public void stopWriting()
public void wantsWrite(NTCPConnection con, String source)