during

Simple idiomatic dlang wrapper around linux io_uring (see: https://kernel.dk/io_uring.pdf) asynchronous API.

Modules

io_uring
module during.io_uring

io_uring system api definitions.

tests
module during.tests

Public Imports

during.io_uring
public import during.io_uring;

Members

Functions

fill
void fill(ref SubmissionEntry entry, auto ref E op)

Uses custom operation definition to fill fields of SubmissionEntry. Can be used in cases, when builtin prep* functions aren't enough.

prepAccept
void prepAccept(ref SubmissionEntry entry, int fd, ref ADDR addr, ref socklen_t addrlen, AcceptFlags flags = AcceptFlags.NONE)

Prepares accept4(2) operation.

prepCancel
void prepCancel(ref SubmissionEntry entry, ref D userData)

Prepares operation that cancels existing async work.

prepConnect
void prepConnect(ref SubmissionEntry entry, int fd, ref const(ADDR) addr)

Note: Available from Linux 5.5

prepFsync
void prepFsync(ref SubmissionEntry entry, int fd, FsyncFlags flags = FsyncFlags.NORMAL)

Prepares fsync operation.

prepLinkTimeout
void prepLinkTimeout(ref SubmissionEntry entry, ref KernelTimespec time, TimeoutFlags flags = TimeoutFlags.REL)

Prepares linked timeout operation.

prepNop
void prepNop(ref SubmissionEntry entry)

Prepares nop operation.

prepPollAdd
void prepPollAdd(ref SubmissionEntry entry, int fd, PollEvents events)

Poll the fd specified in the submission queue entry for the events specified in the poll_events field. Unlike poll or epoll without EPOLLONESHOT, this interface always works in one shot mode. That is, once the poll operation is completed, it will have to be resubmitted.

prepPollRemove
void prepPollRemove(ref SubmissionEntry entry, ref D userData)

Remove an existing poll request. If found, the res field of the CompletionEntry will contain 0. If not found, res will contain -ENOENT.

prepReadFixed
void prepReadFixed(ref SubmissionEntry entry, int fd, ulong offset, ubyte[] buffer, ushort bufferIndex)

Prepares read_fixed operation.

prepReadv
void prepReadv(ref SubmissionEntry entry, int fd, ref const V buffer, ulong offset)

Prepares readv operation.

prepRecvMsg
void prepRecvMsg(ref SubmissionEntry entry, int fd, ref msghdr msg, MsgFlags flags = MsgFlags.NONE)

Prepares recvmsg(2) operation.

prepSendMsg
void prepSendMsg(ref SubmissionEntry entry, int fd, ref msghdr msg, MsgFlags flags = MsgFlags.NONE)

Prepares sendmsg(2) operation.

prepSyncFileRange
void prepSyncFileRange(ref SubmissionEntry entry, int fd, ulong offset, uint len, SyncFileRangeFlags flags)

Prepares sync_file_range(2) operation.

prepTimeout
void prepTimeout(ref SubmissionEntry entry, ref KernelTimespec time, ulong count = 0, TimeoutFlags flags = TimeoutFlags.REL)

This command will register a timeout operation.

prepTimeoutRemove
void prepTimeoutRemove(ref SubmissionEntry entry, ref D userData)

Prepares operations to remove existing timeout registered using TIMEOUToperation.

prepWriteFixed
void prepWriteFixed(ref SubmissionEntry entry, int fd, ulong offset, ubyte[] buffer, ushort bufferIndex)

Prepares write_fixed operation.

prepWritev
void prepWritev(ref SubmissionEntry entry, int fd, ref const V buffer, ulong offset)

Prepares writev operation.

setUserData
void setUserData(ref SubmissionEntry entry, ref D data)

Template function to help set SubmissionEntry user_data field.

setup
int setup(ref Uring uring, uint entries = 128, SetupFlags flags = SetupFlags.NONE)

Setup new instance of io_uring into provided Uring structure.

Structs

Uring
struct Uring

Main entry point to work with io_uring.

Meta