integrated object cache into session and added message bus to object_cache and update tests
This commit is contained in:
@@ -53,6 +53,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void resolver(std::weak_ptr<object_resolver<Type>> resolver) {
|
||||
std::lock_guard lock(mutex_);
|
||||
resolver_ = std::move(resolver);
|
||||
}
|
||||
|
||||
[[nodiscard]] std::shared_ptr<Type> object() const {
|
||||
if (!obj_) {
|
||||
std::ignore = resolve();
|
||||
}
|
||||
return obj_;
|
||||
}
|
||||
|
||||
void invalidate() {
|
||||
std::lock_guard lock(mutex_);
|
||||
obj_.reset();
|
||||
|
||||
Reference in New Issue
Block a user