pub struct WorkerPool {
pub batch_size: usize,
pub timeout_ms: u64,
/* private fields */
}Expand description
Worker pool for parallel HTTP packet processing.
Fields§
§batch_size: usize§timeout_ms: u64Implementations§
Source§impl WorkerPool
impl WorkerPool
Sourcepub fn new(
num_workers: usize,
queue_size: usize,
batch_size: usize,
timeout_ms: u64,
result_sender: Sender<HttpAnalysisResult>,
database: Option<Arc<Database>>,
max_connections: usize,
filter_config: Option<FilterConfig>,
) -> Result<Arc<Self>, HuginnNetHttpError>
pub fn new( num_workers: usize, queue_size: usize, batch_size: usize, timeout_ms: u64, result_sender: Sender<HttpAnalysisResult>, database: Option<Arc<Database>>, max_connections: usize, filter_config: Option<FilterConfig>, ) -> Result<Arc<Self>, HuginnNetHttpError>
Creates a new worker pool for HTTP analysis.
§Parameters
num_workers: Number of worker threadsqueue_size: Size of each worker’s packet queuebatch_size: Maximum packets to process in one batchtimeout_ms: Worker receive timeout in millisecondsresult_sender: Channel to send analysis resultsdatabase: Optional signature database for matchingmax_connections: Maximum HTTP flows to track per workerfilter_config: Optional filter configuration for packet filtering
§Returns
A new WorkerPool or an error if creation fails.
pub fn dispatch(&self, packet: Vec<u8>) -> DispatchResult
pub fn stats(&self) -> PoolStats
Auto Trait Implementations§
impl Freeze for WorkerPool
impl RefUnwindSafe for WorkerPool
impl Send for WorkerPool
impl Sync for WorkerPool
impl Unpin for WorkerPool
impl UnwindSafe for WorkerPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more