diff options
author | Daniel Wigton <daniel@stonecottageweb.com> | 2024-07-06 15:53:10 -0500 |
---|---|---|
committer | Daniel Wigton <daniel@stonecottageweb.com> | 2024-07-06 15:53:10 -0500 |
commit | fa3f0dd7c95897b06a9185317910b2abb474fc28 (patch) | |
tree | 879acc1676eb0d379ca039699ee40e558c465c91 | |
parent | dbf4df01cd58957b23ef2ef8316e31d2524246a8 (diff) |
empty
-rw-r--r-- | include/nostr.hpp | 5 | ||||
-rw-r--r-- | src/nostr_service.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/nostr.hpp b/include/nostr.hpp index b2cdfc5..e699f21 100644 --- a/include/nostr.hpp +++ b/include/nostr.hpp @@ -177,7 +177,8 @@ public: * @brief Queries all open relay connections for events matching the given set of filters, and * returns all stored matching events returned by the relays. * @param filters The filters to use for the query. - * @returns A vector of all events matching the filters from all open relay connections. + * @returns A std::future that will eventually hold a vector of all events matching the filters + * from all open relay connections. * @remark This method runs until the relays send an EOSE message, indicating they have no more * stored events matching the given filters. When the EOSE message is received, the method * will close the subscription for each relay and return the received events. @@ -185,7 +186,7 @@ public: * set on the filters in the range 1-64, inclusive. If no valid limit is given, it will be * defaulted to 16. */ - std::vector<std::shared_ptr<Event>> queryRelays(std::shared_ptr<Filters> filters); + std::future<std::vector<std::shared_ptr<Event>>> queryRelays(std::shared_ptr<Filters> filters); /** * @brief Queries all open relay connections for events matching the given set of filters. diff --git a/src/nostr_service.cpp b/src/nostr_service.cpp index 10d9fc6..83555eb 100644 --- a/src/nostr_service.cpp +++ b/src/nostr_service.cpp @@ -184,7 +184,7 @@ tuple<vector<string>, vector<string>> NostrService::publishEvent(shared_ptr<Even // TODO: Make this method return a promise. // TODO: Add a timeout to this method to prevent hanging while waiting for the relay. -vector<shared_ptr<Event>> NostrService::queryRelays(shared_ptr<Filters> filters) +std::future<vector<shared_ptr<Event>> NostrService::queryRelays(shared_ptr<Filters> filters) { if (filters->limit > 64 || filters->limit < 1) { |