SQLite engine: streams — StreamHandle, extent-guarded reads, trim, durable subscribe (task sqlite-engine-streams)
This commit is contained in:
1 parent
8efe0c2e78
commit
4913302b47
6 files changed
+1507
-48
No files matched your search
@@ -144,12 +144,23 @@ impl Store for SqliteStore {
|
||||
|
||||
fn stream<'a>(
|
||||
&'a self,
|
||||
_name: &str,
|
||||
name: &str,
|
||||
) -> alkstore::BoxedFuture<'a, alkstore::Result<Box<dyn alkstore::StreamHandle>>> {
|
||||
Box::pin(async {
|
||||
Err(database_error(
|
||||
"stream wiring lands with the mechanism tasks",
|
||||
))
|
||||
if let Err(e) = alkstore::validate_shared_name(name) {
|
||||
return Box::pin(async move { Err(e) });
|
||||
}
|
||||
if self.closed.load(std::sync::atomic::Ordering::Acquire) {
|
||||
return Box::pin(async { Err(crate::seam::database_error("the store is closed")) });
|
||||
}
|
||||
let name = name.to_string();
|
||||
let writer = self.writer.clone();
|
||||
let readers = self.readers.clone();
|
||||
let watcher = self.watcher.clone();
|
||||
let closed = self.closed.clone();
|
||||
Box::pin(async move {
|
||||
Ok(Box::new(crate::stream::SqliteStreamHandle::new(
|
||||
name, writer, readers, watcher, closed,
|
||||
)) as Box<dyn alkstore::StreamHandle>)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -225,4 +236,6 @@ mod notify_tests;
|
||||
#[cfg(test)]
|
||||
mod open_tests;
|
||||
#[cfg(test)]
|
||||
mod stream_tests;
|
||||
#[cfg(test)]
|
||||
mod tx_tests;
|
||||
Reference in new issue
Block a user