GithubHelp home page GithubHelp logo

Reconsider API design about tokio-uring HOT 5 OPEN

tokio-rs avatar tokio-rs commented on July 17, 2024 18
Reconsider API design

from tokio-uring.

Comments (5)

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

I'm currently working on this but it's blocked behind another PR which I need to push through first. Hopefully I get the "refactor the runtime to use internal handles" PR up tonight as planned, so that I can resume working on this.

from tokio-uring.

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

An update on this: #244 kicks off the start of this, initially for only oneshot operations.

from tokio-uring.

Ralith avatar Ralith commented on July 17, 2024

In Quinn, we currently bypass tokio 1.0 I/O APIs entirely because they can't possibly express the eclectic collection of options and ancillary data we rely on (e.g. IPV6_TCLASS, IPV6_PKTINFO, their IPv4 analogs, UDP_GRO, UDP_SEGMENT, etc). Something more scaleable would be nice! These interfaces can be pretty diverse, though, so accounting for every possibility may be difficult.

from tokio-uring.

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

@Ralith I know the feelling quite well, and I was actually thinking about some similar issues we've had at work related to the tokio APIs when I came up with this proposal.

I also think that, as a cop out, we could also expose a function which allows "raw" events to be submitted.

from tokio-uring.

mzabaluev avatar mzabaluev commented on July 17, 2024

The explosion of methods exemplified by #184 make me support the idea of builder APIs.

Something like this would be nice:

let n = file.build_write()
    .fixed(buf)
    .at(pos)
    .start()
    .await?;

It may be even possible to eliminate Slice and provide a way to multi-slice a buffer for compound operations:

file.build_write_all()
    .buf(v)
    .multi()
    .slice_at(..5, 0)
    .slice_at(7..10, 5)
    .start()
    .await?;

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.