Uring

Main entry point to work with io_uring.

It hides SubmissionQueue and CompletionQueue behind standard range interface. We put in SubmissionEntry entries and take out CompletionEntry entries.

Use predefined prepXX methods to fill required fields of SubmissionEntry before put or during putWith.

Note: prepXX functions doesn't touch previous entry state, just fills in operation properties. This is because for less error prone interface it is cleared automatically when prepared using putWith. So when using on own SubmissionEntry (outside submission queue), that would be added to the submission queue using put, be sure its cleared if it's reused for multiple operations.

Constructors

this
this(ref return scope Uring rhs)

Copy constructor

Destructor

~this
~this()

Destructor

Members

Functions

capacity
size_t capacity()

Available space in submission queue before it becomes full

dropped
uint dropped()

Counter of invalid submissions (out-of-bound index in submission array)

empty
bool empty()

Check if there is some CompletionEntry to process.

fd
auto fd()

Native io_uring file descriptor

front
CompletionEntry front()

Get first CompletionEntry from cq ring

full
bool full()

Check if there is space for another SubmissionEntry to submit.

length
size_t length()

Number of entries in completion queue

overflow
uint overflow()

If completion queue is full, the new event maybe dropped. This value records number of dropped events.

params
SetupParameters params()

io_uring parameters

popFront
void popFront()

Move to next CompletionEntry

put
Uring put(auto ref SubmissionEntry entry)

Adds new entry to the SubmissionQueue.

put
Uring put(auto ref OP op)

Similar to put(SubmissionEntry) but in this case we can provide our custom type (args) to be filled to next SubmissionEntry in queue.

putWith
Uring putWith(auto ref ARGS args)

Adds new entry to the SubmissionQueue.

registerBuffers
auto registerBuffers(T buffers)

Register single buffer to be mapped into the kernel for faster buffered operations.

registerEventFD
auto registerEventFD(int eventFD)

TODO

registerFiles
auto registerFiles(const(int)[] fds)

Register files for I/O.

submit
auto submit(uint want = 0, const sigset_t* sig = null)

Submits qued SubmissionEntry to be processed by kernel.

unregisterBuffers
auto unregisterBuffers()

Releases all previously registered buffers associated with the io_uring instance.

unregisterEventFD
auto unregisterEventFD()

TODO

unregisterFiles
auto unregisterFiles()

All previously registered files associated with the io_uring instance will be unregistered.

wait
auto wait(uint want = 1, const sigset_t* sig = null)

Simmilar to submit but with this method we just wait for required number of CompletionEntries.

Meta