mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-25 15:06:21 +02:00
Make metadata thread safe, poll properties
This commit is contained in:
parent
1f51befbad
commit
0853c7c701
10 changed files with 124 additions and 100 deletions
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/read_until.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
|
||||
#include "jsonrpcpp.hpp"
|
||||
#include "server_settings.hpp"
|
||||
|
@ -64,17 +65,18 @@ protected:
|
|||
virtual void doCommand(const jsonrpcpp::Request& request) = 0;
|
||||
virtual void doStart(const std::string& stream_id, const ServerSettings& server_setttings) = 0;
|
||||
|
||||
void onNotification(const jsonrpcpp::Notification& notification);
|
||||
void onRequest(const jsonrpcpp::Request& request);
|
||||
void onResponse(const jsonrpcpp::Response& response);
|
||||
void onReceive(const std::string& json);
|
||||
void onLog(std::string message);
|
||||
|
||||
boost::asio::io_context& ioc_;
|
||||
|
||||
private:
|
||||
OnRequest request_handler_;
|
||||
OnNotification notification_handler_;
|
||||
OnLog log_handler_;
|
||||
|
||||
boost::asio::io_context& ioc_;
|
||||
std::map<jsonrpcpp::Id, OnResponse> request_callbacks_;
|
||||
boost::asio::io_context::strand strand_;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue