Asyncify (5th and final pass)
This commit is contained in:
parent
bea156f064
commit
caec0e5109
@ -113,7 +113,7 @@ trait CallHandler
|
|||||||
|
|
||||||
if (is_array($args)) {
|
if (is_array($args)) {
|
||||||
if (isset($args['message']) && is_string($args['message']) && mb_strlen($args['message'], 'UTF-8') > $this->config['message_length_max']) {
|
if (isset($args['message']) && is_string($args['message']) && mb_strlen($args['message'], 'UTF-8') > $this->config['message_length_max']) {
|
||||||
$arg_chunks = $this->split_to_chunks($args);
|
$arg_chunks = yield $this->split_to_chunks_async($args);
|
||||||
$promises = [];
|
$promises = [];
|
||||||
$new_aargs = $aargs;
|
$new_aargs = $aargs;
|
||||||
$new_aargs['postpone'] = true;
|
$new_aargs['postpone'] = true;
|
||||||
@ -129,7 +129,7 @@ trait CallHandler
|
|||||||
|
|
||||||
return yield $promises;
|
return yield $promises;
|
||||||
}
|
}
|
||||||
$args = $this->botAPI_to_MTProto($args);
|
$args = yield $this->botAPI_to_MTProto_async($args);
|
||||||
if (isset($args['ping_id']) && is_int($args['ping_id'])) {
|
if (isset($args['ping_id']) && is_int($args['ping_id'])) {
|
||||||
$args['ping_id'] = $this->pack_signed_long($args['ping_id']);
|
$args['ping_id'] = $this->pack_signed_long($args['ping_id']);
|
||||||
}
|
}
|
||||||
|
@ -519,7 +519,7 @@ trait TL
|
|||||||
public function serialize_params_async($tl, $arguments, $ctx, $layer = -1)
|
public function serialize_params_async($tl, $arguments, $ctx, $layer = -1)
|
||||||
{
|
{
|
||||||
$serialized = '';
|
$serialized = '';
|
||||||
$arguments = $this->botAPI_to_MTProto($arguments);
|
$arguments = yield $this->botAPI_to_MTProto_async($arguments);
|
||||||
$flags = 0;
|
$flags = 0;
|
||||||
foreach ($tl['params'] as $cur_flag) {
|
foreach ($tl['params'] as $cur_flag) {
|
||||||
if (isset($cur_flag['pow'])) {
|
if (isset($cur_flag['pow'])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user