pub struct IOContext<C: IOCallback, Q, W> { /* private fields */ }Expand description
IOContext manages the submission of IO tasks to the underlying driver.
It is generic over the callback type C, the submission queue Q, and the worker type W.
§Channel Selection for W (Worker)
When configuring the IOContext with a worker W (usually a channel sender cb_workers),
you should choose the crossfire channel type based on your sharing model:
-
Shared Worker (Multiple Contexts): If you have multiple
IOContextinstances sharing the same callback worker, use the IOWorkers struct, or passcrossfire::MTx(frommpscormpmcchannels) with your custom worker implementation. This allows multiple producers (contexts) to send completion events to a single consumer (worker). -
Single Instance (Dedicated Worker): If you have a single
IOContextwith its own dedicated callback worker, usecrossfire::Tx(fromspscchannels). This is more efficient for single-producer scenarios. -
inline callback: If you have a very light callback logic, you can use Inline