Skip to content

Commit

Permalink
Add new store::proxy::valid function
Browse files Browse the repository at this point in the history
  • Loading branch information
Neverlord committed Feb 8, 2025
1 parent 9b66096 commit 90e8108
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libbroker/broker/store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ store::proxy::proxy(store& s) {
});
}

bool store::proxy::valid() const noexcept {
return frontend_ && proxy_;
}

request_id store::proxy::exists(data key) {
if (frontend_) {
send_as(native(proxy_), native(frontend_), atom::exists_v, std::move(key),
Expand Down
3 changes: 3 additions & 0 deletions libbroker/broker/store.hh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public:
/// @param s The store to create a proxy for.
explicit proxy(store& s);

/// Checks whether the proxy object is valid.
bool valid() const noexcept;

/// Performs a request to check existence of a value.
/// @returns A unique identifier for this request to correlate it with a
/// response.
Expand Down

0 comments on commit 90e8108

Please sign in to comment.