Futures-rs: AsyncSeek trait

Created on 4 Apr 2019  路  5Comments  路  Source: rust-lang/futures-rs

I've def been missing an AsyncSeek impl. We've been looking to implement a filesystem API for Romio, and that's one of the traits we need. Tokio has a counterpart directly implemented on the File struct, but it seems being able to generalize it would be ideal.

_Originally posted by @yoshuawuyts in https://github.com/rust-lang-nursery/futures-rs/issues/1510#issuecomment-479420306_

Most helpful comment

Just gonna leave this here, we have a PR open in tokio for sometime around this, may be useful https://github.com/tokio-rs/tokio/pull/785

All 5 comments

@yoshuawuyts do you know if there are actual async implementations of seeking available anywhere? I assume the FS API for Romio would just be doing something like a blocking seek on a thread-pool?

I guess it still makes sense to add the trait as an operation that code will want to use, even if there aren't any implementations that can cheaply support it yet.

@yoshuawuyts do you know if there are actual async implementations of seeking available anywhere? I assume the FS API for Romio would just be doing something like a blocking seek on a thread-pool?

Yeah, that's our thinking for Romio currently. Ideally we could later investigate using AIO / io_uring to have _true_ async fs calls, but until then having the trait available would be nice for all implementations (:

Just gonna leave this here, we have a PR open in tokio for sometime around this, may be useful https://github.com/tokio-rs/tokio/pull/785

Thanks so much @taiki-e! 馃帀

Yeah-- huge thanks @taiki-e! All of your recent work on futures-rs has been incredibly helpful <3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jedisct1 picture jedisct1  路  3Comments

vskh picture vskh  路  3Comments

hh9527 picture hh9527  路  4Comments

mqudsi picture mqudsi  路  5Comments

flying-sheep picture flying-sheep  路  3Comments