Change a few function names
This commit is contained in:
parent
1b84c2e683
commit
b9b9e6635d
@ -596,7 +596,7 @@ trait AuthKeyHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$dcs[$id] = function () use ($id, $socket) {
|
$dcs[$id] = function () use ($id, $socket) {
|
||||||
return $this->init_authorization_socket($id, $socket);
|
return $this->init_authorization_socket_async($id, $socket);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if ($dcs) yield array_shift($dcs)();
|
if ($dcs) yield array_shift($dcs)();
|
||||||
@ -606,7 +606,7 @@ trait AuthKeyHandler
|
|||||||
yield $dcs;
|
yield $dcs;
|
||||||
|
|
||||||
foreach ($postpone as $id => $socket) {
|
foreach ($postpone as $id => $socket) {
|
||||||
yield $this->init_authorization_socket($id, $socket);
|
yield $this->init_authorization_socket_async($id, $socket);
|
||||||
}
|
}
|
||||||
//foreach ($dcs as $dc) { yield $dc; }
|
//foreach ($dcs as $dc) { yield $dc; }
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ trait AuthKeyHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init_authorization_socket($id, $socket)
|
public function init_authorization_socket_async($id, $socket)
|
||||||
{
|
{
|
||||||
$this->init_auth_dcs[$id] = true;
|
$this->init_auth_dcs[$id] = true;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ use Amp\Loop;
|
|||||||
*/
|
*/
|
||||||
trait ResponseHandler
|
trait ResponseHandler
|
||||||
{
|
{
|
||||||
public function send_msgs_state_info($req_msg_id, $msg_ids, $datacenter)
|
public function send_msgs_state_info_async($req_msg_id, $msg_ids, $datacenter)
|
||||||
{
|
{
|
||||||
$this->logger->logger("Sending state info for ".count($msg_ids)." message IDs");
|
$this->logger->logger("Sending state info for ".count($msg_ids)." message IDs");
|
||||||
$info = '';
|
$info = '';
|
||||||
@ -168,7 +168,7 @@ trait ResponseHandler
|
|||||||
$only_updates = false;
|
$only_updates = false;
|
||||||
unset($this->datacenter->sockets[$datacenter]->new_incoming[$current_msg_id]);
|
unset($this->datacenter->sockets[$datacenter]->new_incoming[$current_msg_id]);
|
||||||
|
|
||||||
$this->call($this->send_msgs_state_info($current_msg_id, $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'], $datacenter));
|
$this->call($this->send_msgs_state_info_async($current_msg_id, $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'], $datacenter));
|
||||||
unset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']);
|
unset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']);
|
||||||
break;
|
break;
|
||||||
case 'msgs_all_info':
|
case 'msgs_all_info':
|
||||||
@ -230,7 +230,7 @@ trait ResponseHandler
|
|||||||
$this->method_recall('', ['message_id' => $msg_id, 'datacenter' => $datacenter]);
|
$this->method_recall('', ['message_id' => $msg_id, 'datacenter' => $datacenter]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->call($this->send_msgs_state_info($current_msg_id, $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'], $datacenter));
|
$this->call($this->send_msgs_state_info_async($current_msg_id, $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'], $datacenter));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'msg_resend_ans_req':
|
case 'msg_resend_ans_req':
|
||||||
@ -238,7 +238,7 @@ trait ResponseHandler
|
|||||||
$only_updates = false;
|
$only_updates = false;
|
||||||
unset($this->datacenter->sockets[$datacenter]->new_incoming[$current_msg_id]);
|
unset($this->datacenter->sockets[$datacenter]->new_incoming[$current_msg_id]);
|
||||||
|
|
||||||
$this->call($this->send_msgs_state_info($current_msg_id, $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'], $datacenter));
|
$this->call($this->send_msgs_state_info_async($current_msg_id, $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'], $datacenter));
|
||||||
foreach ($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'] as $msg_id) {
|
foreach ($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_ids'] as $msg_id) {
|
||||||
if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']) && isset($this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']])) {
|
if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']) && isset($this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']])) {
|
||||||
$this->call($this->object_call_async($this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']]['_'], $this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']]['body'], ['datacenter' => $datacenter]));
|
$this->call($this->object_call_async($this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']]['_'], $this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$msg_id]['response']]['body'], ['datacenter' => $datacenter]));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user