added infrastructure to track oingoing distant GXS group requests

This commit is contained in:
csoler 2020-10-25 22:47:48 +01:00
parent d086975d54
commit 74edefcc43
11 changed files with 139 additions and 60 deletions

View file

@ -519,10 +519,16 @@ public:
* @param[out] distantGroup storage for group data
* @return false on error, true otherwise
*/
virtual bool getDistantSearchResultGroupData(
const RsGxsGroupId& groupId, RsGxsChannelGroup& distantGroup ) = 0;
virtual bool getDistantSearchResultGroupData(const RsGxsGroupId& groupId, RsGxsChannelGroup& distantGroup ) = 0;
/**
/**
* @brief getDistantSearchStatus
* Returns the status of ongoing search: unknown (probably not even searched), known as a search result,
* data request ongoing and data available
*/
virtual DistantSearchGroupStatus getDistantSearchStatus(const RsGxsGroupId& group_id) =0;
/**
* @brief Clear accumulated search results
* @jsonapi{development}
* @param[in] reqId search id

View file

@ -145,6 +145,14 @@ struct RsGxsChanges : RsEvent
RsTokenService* mService; /// Weak pointer, not serialized
};
enum class DistantSearchGroupStatus:uint8_t
{
UNKNOWN = 0x00, // no search ongoing for this group
CAN_BE_REQUESTED = 0x01, // a search result mentions this group, so the group data can be requested
ONGOING_REQUEST = 0x02, // the group data has been requested and the request is pending
HAVE_GROUP_DATA = 0x03, // group data has been received. Group can be subscribed.
};
/*!
* All implementations must offer thread safety
*/