extended statement_cache with message bus events
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user