mirror of
https://github.com/danog/amp.git
synced 2024-12-03 09:57:51 +01:00
Rename launch to async
Thus we've come full circle :P
This commit is contained in:
parent
31a34bcb18
commit
3926b3f978
@ -91,7 +91,7 @@ final class Future
|
|||||||
/**
|
/**
|
||||||
* @param FutureState<T> $state
|
* @param FutureState<T> $state
|
||||||
*
|
*
|
||||||
* @internal Use {@see Deferred} or {@see launch()} to create and resolve a Future.
|
* @internal Use {@see Deferred} or {@see async()} to create and resolve a Future.
|
||||||
*/
|
*/
|
||||||
public function __construct(FutureState $state)
|
public function __construct(FutureState $state)
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ use Revolt\EventLoop\UnsupportedFeatureException;
|
|||||||
*
|
*
|
||||||
* @return Future<T>
|
* @return Future<T>
|
||||||
*/
|
*/
|
||||||
function launch(\Closure $closure): Future
|
function async(\Closure $closure): Future
|
||||||
{
|
{
|
||||||
static $run = null;
|
static $run = null;
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ use Amp\PHPUnit\LoopCaughtException;
|
|||||||
use Amp\PHPUnit\TestException;
|
use Amp\PHPUnit\TestException;
|
||||||
use Amp\TimeoutCancellationToken;
|
use Amp\TimeoutCancellationToken;
|
||||||
use Revolt\EventLoop;
|
use Revolt\EventLoop;
|
||||||
|
use function Amp\async;
|
||||||
use function Amp\delay;
|
use function Amp\delay;
|
||||||
use function Amp\launch;
|
|
||||||
|
|
||||||
class FutureTest extends AsyncTestCase
|
class FutureTest extends AsyncTestCase
|
||||||
{
|
{
|
||||||
@ -319,13 +319,13 @@ class FutureTest extends AsyncTestCase
|
|||||||
* @template T
|
* @template T
|
||||||
*
|
*
|
||||||
* @param float $seconds
|
* @param float $seconds
|
||||||
* @param T $value
|
* @param T $value
|
||||||
*
|
*
|
||||||
* @return Future<T>
|
* @return Future<T>
|
||||||
*/
|
*/
|
||||||
private function delay(float $seconds, mixed $value): Future
|
private function delay(float $seconds, mixed $value): Future
|
||||||
{
|
{
|
||||||
return launch(
|
return async(
|
||||||
/**
|
/**
|
||||||
* @return T
|
* @return T
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user