pub struct MergeSubmitter<C: CbArgs, S: BlockingTxTrait<Box<IOEvent<C>>>> { /* private fields */ }Expand description
Manages the submission of IO events, attempting to merge sequential events before sending them to the IO driver.
This component buffers incoming IOEvents into a MergeBuffer.
It ensures that events for the same file descriptor and IO action are
considered for merging to optimize system calls.
Implementations§
Source§impl<C: CbArgs, S: BlockingTxTrait<Box<IOEvent<C>>>> MergeSubmitter<C, S>
impl<C: CbArgs, S: BlockingTxTrait<Box<IOEvent<C>>>> MergeSubmitter<C, S>
Sourcepub fn add_event(&mut self, event: IOEvent<C>) -> Result<(), Errno>
pub fn add_event(&mut self, event: IOEvent<C>) -> Result<(), Errno>
Adds an IOEvent to the internal buffer, potentially triggering a flush.
If the event cannot be merged with current buffered events (e.g., non-contiguous,
exceeding merge limit), the existing buffered events are flushed first.
If adding the new event fills the buffer to its merge_size_limit, a flush is also triggered.
§Arguments
event- TheIOEventto add.
§Returns
An Ok(()) on success.
When submit sender closed, set Errno::SHUTDOWN on event and return the same Errno
On debug mode, will validate event.fd and event.action.