server: expose subscription runtime catalog
This commit is contained in:
@@ -200,6 +200,18 @@ impl RuntimeSubscriptionBroker {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn runtime_ids(&self) -> Vec<String> {
|
||||
let mut runtime_ids = self
|
||||
.registrations
|
||||
.read()
|
||||
.expect("broker registry poisoned")
|
||||
.keys()
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
runtime_ids.sort();
|
||||
runtime_ids
|
||||
}
|
||||
|
||||
pub fn status(&self, runtime_id: &str) -> Option<RuntimeSubscriptionBrokerStatus> {
|
||||
let status = self
|
||||
.registrations
|
||||
|
||||
@@ -283,6 +283,7 @@ async fn embedded_runtime_uses_in_process_subscription_source() {
|
||||
let worker = runtime.list_workers().unwrap().remove(0);
|
||||
let broker = RuntimeSubscriptionBroker::new("local");
|
||||
broker.register_embedded_runtime("embedded-worker-runtime", runtime.clone());
|
||||
assert_eq!(broker.runtime_ids(), vec!["embedded-worker-runtime"]);
|
||||
let mut subscription = broker
|
||||
.subscribe(
|
||||
"embedded-worker-runtime",
|
||||
|
||||
Reference in New Issue
Block a user