ClientActor: create Td on desired thread.

This commit is contained in:
levlam 2022-10-04 19:02:31 +03:00
parent 8d1ee490ad
commit b9c5518c91
2 changed files with 11 additions and 3 deletions

View File

@ -12,10 +12,14 @@
namespace td {
ClientActor::ClientActor(unique_ptr<TdCallback> callback, Options options) {
ClientActor::ClientActor(unique_ptr<TdCallback> callback, Options options)
: callback_(std::move(callback)), options_(std::move(options)) {
}
void ClientActor::start_up() {
Td::Options td_options;
td_options.net_query_stats = std::move(options.net_query_stats);
td_ = create_actor<Td>("Td", std::move(callback), std::move(td_options));
td_options.net_query_stats = std::move(options_.net_query_stats);
td_ = create_actor<Td>("Td", std::move(callback_), std::move(td_options));
}
void ClientActor::request(uint64 id, td_api::object_ptr<td_api::Function> request) {

View File

@ -81,7 +81,11 @@ class ClientActor final : public Actor {
ClientActor &operator=(const ClientActor &other) = delete;
private:
void start_up() final;
ActorOwn<Td> td_;
unique_ptr<TdCallback> callback_;
Options options_;
};
/**