Listen for responses of supervisors

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-09-04 16:24:15 +02:00
parent c6077623b0
commit 059d5131e7
6 changed files with 423 additions and 8 deletions

View File

@@ -1161,6 +1161,37 @@ impl AppService {
pub async fn scan_runners(&self, context_id: u32) -> Result<Vec<Runner>, BoxError> {
self.redis.scan_runners(context_id).await
}
/// Correlation map: store mapping from inner supervisor JSON-RPC id to context/caller/job/message.
pub async fn supcorr_set(
&self,
inner_id: u64,
context_id: u32,
caller_id: u32,
job_id: u32,
message_id: u32,
) -> Result<(), BoxError> {
self.redis
.supcorr_set(inner_id, context_id, caller_id, job_id, message_id)
.await
.map_err(Into::into)
}
/// Correlation map: load mapping by inner supervisor JSON-RPC id.
pub async fn supcorr_get(
&self,
inner_id: u64,
) -> Result<Option<(u32, u32, u32, u32)>, BoxError> {
self.redis
.supcorr_get(inner_id)
.await
.map_err(Into::into)
}
/// Correlation map: delete mapping by inner supervisor JSON-RPC id.
pub async fn supcorr_del(&self, inner_id: u64) -> Result<(), BoxError> {
self.redis.supcorr_del(inner_id).await.map_err(Into::into)
}
}
/// Auto-discovery helpers for contexts (wrappers over RedisDriver)