Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Jun 3, 2019
1 parent da911f8 commit f76840d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/docs/ASYNC.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class MyLoop extends Loop
public function loop()
{
$MadelineProto = $this->API;
$logger = $MadelineProto->logger;
$logger = &$MadelineProto->logger;
$callable = $this->callable;

$result = null;
Expand Down Expand Up @@ -442,7 +442,7 @@ class MySuperLoop extends ResumableSignalLoop
public function loop()
{
$MadelineProto = $this->API;
$logger = $MadelineProto->logger;
$logger = &$MadelineProto->logger;

while (true) {
$t = time();
Expand Down Expand Up @@ -516,4 +516,4 @@ The return value of the callable can be:
* `GenericLoop::PAUSE` - The loop will pause forever (or until the `resume` method is called on the loop object from outside the loop)
* `GenericLoop::CONTINUE` - Return this if you want to rerun the loop without waiting

<a href="https://docs.madelineproto.xyz/docs/CREATING_A_CLIENT.html">Next section</a>
<a href="https://docs.madelineproto.xyz/docs/CREATING_A_CLIENT.html">Next section</a>
2 changes: 2 additions & 0 deletions docs/docs/UPDATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ $this->{'user2.madeline'}->messages->sendMessage(['peer' => '@danogentili', 'mes

If you intend to use your own constructor in the event handler, make sure to call the parent construtor with the only parameter provided to your constructor.

If you need to use the [__sleep](https://www.php.net/manual/en/language.oop5.magic.php#object.sleep) function, make sure it is called `__magic_sleep`, instead.

The update handling loop is started by the `$MadelineProto->loop()` method, and it will automatically restart the script if execution time runs out.

To break out of the loop just call `die();`, or throw an exception from within (make sure to catch it outside, in the `$MadelineProto->loop()` call).
Expand Down

0 comments on commit f76840d

Please sign in to comment.