class IOR::IOUring

Defined in:

ior/uring.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(size : Int32 = 32, sq_poll : Bool = false, io_poll : Bool = false, worker : IOUring | Nil = nil) #

Regarding worker, it is quite useless now as it only works with sqpoll set. It used to be more useful.


[View source]
def self.new(**options, &) #

[View source]

Instance Method Detail

def close #

[View source]
def closed? : Bool #

[View source]
def cq_ready #

Completion events waiting for processing.


[View source]
def fd #

[View source]
def finalize #

[View source]
def full_submission_queue? #

Returns true if the submission queue is full.


[View source]
def io_poll : Bool #

[View source]
def peek #

Returns next event if one is available.


[View source]
def peek(into cqes, &) #

Peek and yield multiple CQEs, using a provided buffer as intermediary cache.


[View source]
def peek(&) #

Yields next event if available, and marks it as seen when done.


[View source]
def register_files(files) #

Register files for less costly access. Note: Registering will replace any other registered files.

TODO Support io_uring_register_files_update when kernel get support for it.


[View source]
def seen(cqe : IOR::CQE) #

Marks an event as consumed


[View source]
def size : Int32 #

[View source]
def sq_poll : Bool #

[View source]
def sq_ready #

Return how many unsubmitted entries there is in the submission queue.


[View source]
def sq_space_left #

Space left in the submission queue.


[View source]
def sqe #

Returns a sqe if there is space available, or nil.


[View source]
def sqe! : SQE #

[View source]
def submit #

Submit events to kernel


[View source]
def submit_and_wait(nr = 1) #

Submit events to kernel, and wait for nr responses. Saves a syscall compared to submit followed by wait. Returns submission count so user will still need a call to wait to actually get to the result.


[View source]
def unregister_files #

[View source]
def unsubmitted? #

Returns true if there are any unsubmitted SQEs.


[View source]
def wait(nr, timeout : Pointer(LibC::Timespec)) : CQE | Nil #

Returns next event unless timeout happens. Waits for nr events to be completed if none are available


[View source]
def wait(timeout : Pointer(LibC::Timespec)) : CQE | Nil #

Returns next event. Waits for an event to be completed if none are available.


[View source]
def wait(nr) : CQE #

Returns next event. Waits for nr events to be completed if none are available


[View source]
def wait : CQE #

Returns next event. Waits for an event to be completed if none are available


[View source]
def wait(timeout : Pointer(LibC::Timespec), &) #

Yields next event unless a timeout happens, and marks it as seen when done.


[View source]
def wait(&) #

Yields next event, and marks it as seen when done.


[View source]