mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 14:12:43 -04:00
Implement JSON API generation for async API calls
Move JSON helpers to util/rsjson.* for better usability Implement JSON ostream manipulator to print compact and pretty JSON Use lambdas for API wrappers, integrate better and avoid namespace pollution Removed experimental JSON API for notify client wrapper, notifications can be implemented automatically with moderns async API calls Implement and automatically expose to JSON API RsGxsChannels::turtleSearchRequest( const std::string& matchString, const std::function<void (const RsGxsGroupSummary&)>& multiCallback, std::time_t maxWait )
This commit is contained in:
parent
b7f5d4286f
commit
4b6f751b09
15 changed files with 444 additions and 177 deletions
|
@ -21,7 +21,6 @@
|
|||
#include <restbed>
|
||||
|
||||
#include "util/rsthreads.h"
|
||||
#include "retroshare/rsnotify.h"
|
||||
|
||||
namespace rb = restbed;
|
||||
|
||||
|
@ -70,20 +69,5 @@ private:
|
|||
uint16_t mPort;
|
||||
rb::Service mService;
|
||||
const std::function<void(int)> mShutdownCallback;
|
||||
|
||||
std::list<std::shared_ptr<rb::Session> > notifySessions;
|
||||
void cleanClosedNotifySessions();
|
||||
|
||||
struct NotifyClientWrapper : NotifyClient
|
||||
{
|
||||
NotifyClientWrapper(JsonApiServer& parent);
|
||||
|
||||
void notifyTurtleSearchResult(
|
||||
uint32_t searchId, const std::list<TurtleFileInfo>& files);
|
||||
|
||||
private:
|
||||
JsonApiServer& mJsonApiServer;
|
||||
};
|
||||
NotifyClientWrapper notifyClientWrapper;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue