mirror of
https://github.com/danog/asyncConstruct.git
synced 2025-01-05 20:28:21 +01:00
20 lines
329 B
PHP
20 lines
329 B
PHP
|
<?php
|
||
|
|
||
|
namespace danog\Test\Fixtures;
|
||
|
|
||
|
use danog\AsyncConstruct;
|
||
|
|
||
|
use function Amp\delay;
|
||
|
|
||
|
class AsyncConstructTest
|
||
|
{
|
||
|
use AsyncConstruct;
|
||
|
public $inited = false;
|
||
|
protected function __construct_async(int $delay): \Generator
|
||
|
{
|
||
|
yield delay($delay);
|
||
|
$this->inited = true;
|
||
|
return true;
|
||
|
}
|
||
|
}
|