Split acks

This commit is contained in:
Daniil Gentili 2019-06-02 11:54:56 +02:00
parent ab6175575e
commit 62c29c9415
2 changed files with 6 additions and 2 deletions

View File

@ -16,6 +16,8 @@
* sendmessage with secret messages
* 2fa+++++
* improved callfork
* split acks
Things to expect in the next releases:
Document async apis
optional max_id and min_id

View File

@ -139,8 +139,10 @@ class WriteLoop extends ResumableSignalLoop
return;
}
if (count($to_ack = $connection->ack_queue)) {
$connection->pending_outgoing[$connection->pending_outgoing_key++] = ['_' => 'msgs_ack', 'serialized_body' => yield $this->API->serialize_object_async(['type' => 'msgs_ack'], ['msg_ids' => $connection->ack_queue], 'msgs_ack'), 'content_related' => false, 'unencrypted' => false, 'method' => false];
$connection->pending_outgoing_key %= Connection::PENDING_MAX;
foreach (array_chunk($connection->ack_queue, 8192) as $acks) {
$connection->pending_outgoing[$connection->pending_outgoing_key++] = ['_' => 'msgs_ack', 'serialized_body' => yield $this->API->serialize_object_async(['type' => 'msgs_ack'], ['msg_ids' => $acks], 'msgs_ack'), 'content_related' => false, 'unencrypted' => false, 'method' => false];
$connection->pending_outgoing_key %= Connection::PENDING_MAX;
}
}
$has_http_wait = false;