Allow registration and unregistration of transaction observers from Conn
This commit is contained in:
parent
9f3d2c08b2
commit
c2e5052877
1 changed files with 9 additions and 0 deletions
|
@ -58,6 +58,7 @@ use mentat_db::{
|
|||
transact_terms,
|
||||
PartitionMap,
|
||||
TxObservationService,
|
||||
TxObserver,
|
||||
TxReport,
|
||||
};
|
||||
|
||||
|
@ -813,6 +814,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