MadelineProtoDocs/docs/PHPInternal/danog/MadelineProto/Loop/Connection/HttpWaitLoop.md

121 lines
2.0 KiB
Markdown
Raw Normal View History

2020-10-15 18:42:54 +02:00
---
title: danog\MadelineProto\Loop\Connection\HttpWaitLoop: HttpWait loop.
description:
---
# `danog\MadelineProto\Loop\Connection\HttpWaitLoop`
[Back to index](../../../../index.md)
> Author: Daniil Gentili <daniil@daniil.it>
HttpWait loop.
## Method list:
* `loop(): \Generator`
* `pause(?int $time): \Promise Resolved when the loop is resumed`
* `resume(): \Promise Resolved when the loop is paused again`
* `resumeDefer(): \Promise Resolved when the loop is paused again`
* `start(): bool`
* `isRunning(): bool`
* `signal(mixed|\Throwable $what): void`
* `waitSignal(\Promise|\Generator $promise): \Promise`
## Methods:
### `loop(): \Generator`
Main loop.
#### See also:
* `\Generator`
### `pause(?int $time): \Promise Resolved when the loop is resumed`
Pause the loop.
Parameters:
* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop)
Return value: Resolved when the loop is resumed
### `resume(): \Promise Resolved when the loop is paused again`
Resume the loop.
Return value: Resolved when the loop is paused again
### `resumeDefer(): \Promise Resolved when the loop is paused again`
Defer resuming the loop to next tick.
Return value: Resolved when the loop is paused again
### `start(): bool`
Start the loop.
Returns false if the loop is already running.
### `isRunning(): bool`
Check whether loop is running.
### `signal(mixed|\Throwable $what): void`
Send signal to loop.
Parameters:
* `$what`: `mixed|\Throwable` Data to signal
#### See also:
* `\Throwable`
### `waitSignal(\Promise|\Generator $promise): \Promise`
Resolve the promise or return|throw the signal.
Parameters:
* `$promise`: `\Promise|\Generator` The original promise or generator
Full type:
```
\Promise<\T>|\Generator<mixed, \Promise|array<array-key, \Promise>, mixed, \Promise<\T>|\T>
```
Fully typed return value:
```
\Promise<\T|mixed>
```
#### See also:
* `\Promise`
* `\Generator`
* `\T`
2020-10-15 19:11:10 +02:00
---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)