mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 02:34:20 +01:00
Merge 'Add libsql_wal_get_frame() API' from Pekka Enberg
This pull request implements the `libsql_wal_get_frame()` API. To do that, we also introduce a `wait_for_completion()` API in I/O dispatcher. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #1533
This commit is contained in:
@@ -462,8 +462,8 @@ impl DatabaseFile {
|
||||
}
|
||||
|
||||
impl limbo_core::DatabaseStorage for DatabaseFile {
|
||||
fn read_page(&self, page_idx: usize, c: limbo_core::Completion) -> limbo_core::Result<()> {
|
||||
let r = match c {
|
||||
fn read_page(&self, page_idx: usize, c: Arc<limbo_core::Completion>) -> limbo_core::Result<()> {
|
||||
let r = match *c {
|
||||
limbo_core::Completion::Read(ref r) => r,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
@@ -481,7 +481,7 @@ impl limbo_core::DatabaseStorage for DatabaseFile {
|
||||
&self,
|
||||
page_idx: usize,
|
||||
buffer: Arc<std::cell::RefCell<limbo_core::Buffer>>,
|
||||
c: limbo_core::Completion,
|
||||
c: Arc<limbo_core::Completion>,
|
||||
) -> limbo_core::Result<()> {
|
||||
let size = buffer.borrow().len();
|
||||
let pos = (page_idx - 1) * size;
|
||||
@@ -489,7 +489,7 @@ impl limbo_core::DatabaseStorage for DatabaseFile {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn sync(&self, c: limbo_core::Completion) -> limbo_core::Result<()> {
|
||||
fn sync(&self, c: Arc<limbo_core::Completion>) -> limbo_core::Result<()> {
|
||||
self.file.sync(c)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user