2019-07-19 00:02:18 +02:00
|
|
|
<?php
|
2020-01-31 19:29:43 +01:00
|
|
|
|
2019-07-19 00:02:18 +02:00
|
|
|
/**
|
2020-07-28 20:39:32 +02:00
|
|
|
* Update feeder loop.
|
2019-07-19 00:02:18 +02:00
|
|
|
*
|
|
|
|
* This file is part of MadelineProto.
|
|
|
|
* MadelineProto is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
* MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU Affero General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License along with MadelineProto.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* @author Daniil Gentili <daniil@daniil.it>
|
2020-02-17 14:13:46 +01:00
|
|
|
* @copyright 2016-2020 Daniil Gentili <daniil@daniil.it>
|
2019-07-19 00:02:18 +02:00
|
|
|
* @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
|
|
|
|
*
|
2019-10-31 15:07:35 +01:00
|
|
|
* @link https://docs.madelineproto.xyz MadelineProto documentation
|
2019-07-19 00:02:18 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace danog\MadelineProto\Loop\Generic;
|
|
|
|
|
2020-07-28 20:39:32 +02:00
|
|
|
use danog\Loop\Generic\PeriodicLoop as GenericPeriodicLoop;
|
|
|
|
use danog\MadelineProto\InternalDoc;
|
|
|
|
use danog\MadelineProto\Loop\APILoop;
|
2019-07-19 00:02:18 +02:00
|
|
|
|
|
|
|
/**
|
2020-07-28 20:39:32 +02:00
|
|
|
* {@inheritDoc}
|
2019-07-19 00:02:18 +02:00
|
|
|
*
|
2020-07-28 20:39:32 +02:00
|
|
|
* @deprecated Use the danog/loop API instead
|
2019-07-19 00:02:18 +02:00
|
|
|
*/
|
2020-07-28 20:39:32 +02:00
|
|
|
class PeriodicLoop extends GenericPeriodicLoop
|
2019-07-19 00:02:18 +02:00
|
|
|
{
|
2020-07-28 20:39:32 +02:00
|
|
|
use APILoop {
|
|
|
|
__construct as private init;
|
|
|
|
}
|
2019-07-19 00:02:18 +02:00
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*
|
2020-07-28 20:39:32 +02:00
|
|
|
* @param InternalDoc $API API instance
|
|
|
|
* @param callable $callable Method
|
|
|
|
* @param string $name Loop name
|
|
|
|
* @param ?int $interval Interval
|
2019-07-19 00:02:18 +02:00
|
|
|
*/
|
2020-07-28 20:39:32 +02:00
|
|
|
public function __construct(InternalDoc $API, callable $callable, string $name, ?int $interval)
|
2019-07-19 00:02:18 +02:00
|
|
|
{
|
2020-07-28 20:39:32 +02:00
|
|
|
$this->init($API);
|
|
|
|
parent::__construct($callable, $name, $interval === null ? $interval : $interval * 1000);
|
2019-07-19 00:02:18 +02:00
|
|
|
}
|
|
|
|
}
|