tokio-uring icon indicating copy to clipboard operation
tokio-uring copied to clipboard

op: add recv_multi

Open FrankReh opened this issue 2 years ago • 1 comments

The first operation that supports streaming CQE results.

Adds a Streamable trait, along the lines of the Completable trait. Comes with stream_next and stream_complete methods.

Adds MultiCQEStream struct, along the lines of the MultiCQEFuture struct.

Adds a submit_op_stream along the lines of submit_op.

Adds poll_next_op along the lines of poll_op.

The Lifecycle gets two additional methods: take_index, and data.

take_index: returns the Lifecycle index and replaces it with
usize::MAX to show the Lifecycle is no longer represented in the
slab. This feature only used by the new poll_next_op.

data: returns a reference to the Lifecycle's data, to be able to use
it for the Streamable's stream_next calls which only require a
reference. Ownership is still transferred in stream_complete.

Adds the io/recv_multi operation.

The tcp stream recv_multi is a function that bridges the private types with a public function.

There is no cancel yet for the multishot command but the code can be written to break out of the loop. Also, when the connection is closed, the command should fail. It's not tested, but unregistering the buf_ring might cancel the command too - but maybe not.

Unit tests:

net unit tests and helper functions return io::Return

add recv_multi cases

add BufRingProps to net unit tests - to quiet empty buffer warnings which are intentional in some tests

FrankReh avatar Feb 26 '23 23:02 FrankReh

This starts as one commit over

  • #245

So 245 should be reviewed first.

FrankReh avatar Feb 26 '23 23:02 FrankReh