class

Rayo::Ring

Inherits Reference < Object

Constructors

new(fd : Int32, base : Int32, slots : Int32, pa : Pointer(LibUring::Params))
Source

Class methods

create(base : Int32, slots : Int32, sq : UInt32, cq : UInt32) : Ring | Nil

Returns nil when the kernel refuses (no io_uring, or older than 6.1).

Source
error
Source

Instance methods

accepting
Source
accepting=(accepting : Int32)
Source
base
Source
buf(bid : UInt16) : Pointer(UInt8)
Source
defer_recv(id : Int32) : Nil
Source
dispose
Source
drain

Runs every completion that is ready. Returns how many.

Source
enter(min : UInt32, flags : UInt32, wait : Int32 = -1) : Nil
Source
give_buf(bid : UInt16) : Nil
Source
init

Fixed-file table, provided-buffer ring, first accept.

Source
install(fd : Int32) : Int32
Source
load_acq(p : Pointer(UInt32)) : UInt32
Source
provide(bid : UInt16, count : Int32) : Nil

One PROVIDE_BUFFERS request for count consecutive buffers from bid. It completes inline at submit, before any receive queued after it, and posts no completion.

Source
publish_bufs
Source
ready?
Source
release_slot(slot : Int32) : Nil
Source
retry_recvs

Rearms the receives that hit ENOBUFS, now that this batch's buffers are back. Ones that find none again just come back next batch: never a resubmit loop inside one batch.

Source
slots
Source
sqe

Next free SQE, zeroed. A full queue is submitted first.

Source
store_rel(p : Pointer(T), v : T) : Nil forall T
Source
to_submit
Source
to_submit=(to_submit : UInt32)
Source
used
Source
used=(used : Int32)
Source
watch(ep : Int32) : Nil

Register lazily: the common single-ring path waits in enter, without epoll.

Source