extended statement_cache with message bus events

This commit is contained in:
2025-08-10 22:12:13 +02:00
parent 60cef7e938
commit 4f017ac1de
4 changed files with 87 additions and 62 deletions
+3 -3
View File
@@ -152,16 +152,16 @@ public:
}
};
std::function<bool(const T&)> filt = nullptr;
std::function<bool(const T&)> local_filter = nullptr;
if (filter) {
filt = [w, filter = std::move(filter)](const T& m) -> bool {
local_filter = [w, filter = std::move(filter)](const T& m) -> bool {
if (w.expired()) {
return false;
}
return filter(m);
};
}
return subscribe<T>(std::move(handler), std::move(filt));
return subscribe<T>(std::move(handler), std::move(local_filter));
}
// Unsubscribe by type-specific id (RAII calls this)