Allow registration and unregistration of transaction observers from Conn
This commit is contained in:
parent
cf510e758f
commit
77c91c71df
1 changed files with 9 additions and 0 deletions
|
@ -58,6 +58,7 @@ use mentat_db::{
|
|||
transact_terms,
|
||||
PartitionMap,
|
||||
TxObservationService,
|
||||
TxObserver,
|
||||
TxReport,
|
||||
};
|
||||
|
||||
|
@ -806,6 +807,14 @@ impl Conn {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn register_observer(&mut self, key: String, observer: Arc<TxObserver>) {
|
||||
self.tx_observer_service.lock().unwrap().register(key, observer);
|
||||
}
|
||||
|
||||
pub fn unregister_observer(&mut self, key: &String) {
|
||||
self.tx_observer_service.lock().unwrap().deregister(key);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in a new issue