mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-18 05:30:37 +00:00
actually require it to be a Send future
This commit is contained in:
@@ -8,19 +8,21 @@ mod virtual_file;
|
||||
async fn main() {
|
||||
page_cache::init(10);
|
||||
|
||||
let cache = page_cache::get();
|
||||
tokio::spawn(async move {
|
||||
let cache = page_cache::get();
|
||||
|
||||
let res = cache
|
||||
.read_immutable_buf(page_cache::next_file_id(), 0)
|
||||
.await
|
||||
.unwrap();
|
||||
match res {
|
||||
page_cache::ReadBufResult::Found(found) => todo!(),
|
||||
page_cache::ReadBufResult::NotFound(write_guard) => {
|
||||
let file = VirtualFile::open(camino::Utf8Path::new("foo"))
|
||||
.await
|
||||
.unwrap();
|
||||
file.read_exact_at(write_guard, 0).await;
|
||||
let res = cache
|
||||
.read_immutable_buf(page_cache::next_file_id(), 0)
|
||||
.await
|
||||
.unwrap();
|
||||
match res {
|
||||
page_cache::ReadBufResult::Found(found) => todo!(),
|
||||
page_cache::ReadBufResult::NotFound(write_guard) => {
|
||||
let file = VirtualFile::open(camino::Utf8Path::new("foo"))
|
||||
.await
|
||||
.unwrap();
|
||||
file.read_exact_at(write_guard, 0).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user