File tree Expand file tree Collapse file tree
libsql-server/src/namespace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use std::{collections::HashMap, fs::read_dir};
66use bottomless:: bottomless_wal:: BottomlessWalWrapper ;
77use bottomless:: replicator:: CompressionKind ;
88use bottomless:: SavepointTracker ;
9+ use futures:: Stream ;
910use futures_core:: Future ;
1011use libsql_replication:: rpc:: metadata;
1112use libsql_sys:: wal:: {
@@ -608,6 +609,24 @@ impl MetaStore {
608609 }
609610 None
610611 }
612+
613+ /// returns an iterator over all manespaces config handles
614+ pub ( crate ) fn namespaces ( & self ) -> impl Stream < Item = MetaStoreHandle > + ' _ {
615+ async_stream:: stream! {
616+ let lock = self . inner. configs. lock( ) . await ;
617+ for ( ns, sender) in lock. iter( ) {
618+ let change_tx = self . changes_tx. clone( ) ;
619+
620+
621+ let handle = MetaStoreHandle {
622+ namespace: ns. clone( ) ,
623+ inner: HandleState :: External ( change_tx, sender. subscribe( ) ) ,
624+ } ;
625+
626+ yield handle;
627+ }
628+ }
629+ }
611630}
612631
613632impl MetaStoreHandle {
You can’t perform that action at this time.
0 commit comments