GithubHelp home page GithubHelp logo

Comments (3)

Noah-Kennedy avatar Noah-Kennedy commented on July 17, 2024

I think we can try and handle some of these. EGAIN and EBUSY should be doable for instance. Most of these should just be panics though.

from tokio-uring.

FrankReh avatar FrankReh commented on July 17, 2024

@Noah-Kennedy Sounds good. I'll work on that soon.

That begs the question whether submit_with in

pub(super) fn submit_with<F>(data: T, f: F) -> io::Result<Op<T>>
where
F: FnOnce(&mut T) -> squeue::Entry,
{
driver::CURRENT.with(|inner_rc| {
let mut inner_ref = inner_rc.borrow_mut();
let inner = &mut *inner_ref;
// If the submission queue is full, flush it to the kernel
if inner.uring.submission().is_full() {
inner.submit()?;
}
// Create the operation
let mut op = Op::new(data, inner, inner_rc);
// Configure the SQE
let sqe = f(op.data.as_mut().unwrap()).user_data(op.index as _);
{
let mut sq = inner.uring.submission();
// Push the new operation
if unsafe { sq.push(&sqe).is_err() } {
unimplemented!("when is this hit?");
}
}
Ok(op)
})
}

should continue to return an io::Result.

An argument could be made that it future proofs it, even if there is no possible error returned right now, there might be in the future.

But I slightly favor changing the return type to simply Op<T>.

I don't have a feel for whether this would be considered a drastic change. The whole crate is still considered a POC I believe so breaking changes should still be acceptable.

from tokio-uring.

Noah-Kennedy avatar Noah-Kennedy commented on July 17, 2024

Breaking changes are definitely acceptable at this stage if they move the API in a better direction.

from tokio-uring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.