aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/ClientActor.cpp
diff options
context:
space:
mode:
authorArseny Smirnov <arseny30@gmail.com>2018-12-31 22:04:05 +0300
committerArseny Smirnov <arseny30@gmail.com>2017-12-31 23:08:40 +0300
commit71d03f39c364367a8a7c51f783a41099297de826 (patch)
tree4c0c57f9ddb87f46d58192e1ebfd2c40f6d2c315 /td/telegram/ClientActor.cpp
Project import generated by Copybara.
GitOrigin-RevId: 318483224ad6164d9966f731d60cde37039bb2d4
Diffstat (limited to 'td/telegram/ClientActor.cpp')
-rw-r--r--td/telegram/ClientActor.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/td/telegram/ClientActor.cpp b/td/telegram/ClientActor.cpp
new file mode 100644
index 000000000..55fa14d40
--- /dev/null
+++ b/td/telegram/ClientActor.cpp
@@ -0,0 +1,37 @@
+//
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2017
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+#include "td/telegram/ClientActor.h"
+
+#include "td/telegram/td_api.h"
+
+#include "td/telegram/net/NetQueryCounter.h"
+#include "td/telegram/Td.h"
+
+namespace td {
+ClientActor::ClientActor(unique_ptr<TdCallback> callback) {
+ td_ = create_actor<Td>("Td", std::move(callback));
+}
+
+void ClientActor::request(uint64 id, td_api::object_ptr<td_api::Function> request) {
+ send_closure(td_, &Td::request, id, std::move(request));
+}
+
+ClientActor::~ClientActor() = default;
+
+ClientActor::ClientActor(ClientActor &&other) = default;
+
+ClientActor &ClientActor::operator=(ClientActor &&other) = default;
+
+td_api::object_ptr<td_api::Object> ClientActor::execute(td_api::object_ptr<td_api::Function> request) {
+ return Td::static_request(std::move(request));
+}
+
+uint64 get_pending_network_query_count() {
+ return NetQueryCounter::get_count();
+}
+
+} // namespace td